1
0
mirror of https://gitlab.com/MisterBiggs/astro-helper.git synced 2025-08-02 19:31:23 +00:00

added structures

This commit is contained in:
2021-01-28 00:34:07 -07:00
parent df3965f8ab
commit fd765a7672
4 changed files with 47 additions and 6 deletions

View File

@@ -1,7 +1,8 @@
module AstroHelper
using LinearAlgebra
using DataFrames
include("quaternions.jl")
include("aeStructures.jl")
end # module

30
src/aeStructures.jl Normal file
View File

@@ -0,0 +1,30 @@
struct Section
data::DataFrame
xc::Float64
yc::Float64
Ixx::Float64
Iyy::Float64
Ixy::Float64
function Section(A, x, y)
d = DataFrame(A=A, x=x, y=y)
d.Ax = d.A .* d.x
d.Ay = d.A .* d.y
xc = sum(d.Ax) / sum(d.A)
yc = sum(d.Ay) / sum(d.A)
Ixx = sum(d.A .* ((d.y .- yc).^2))
Iyy = sum(d.A .* ((d.x .- xc).^2))
Ixy = sum(d.A .* ((d.x .- xc) .* (d.y .- yc)))
new(d, xc, yc, Ixx, Iyy, Ixy)
end
end