Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract type Panel <: Solution end
- struct Panel2D <: Panel
- xs :: Float64
- ys :: Float64
- xe :: Float64
- ye :: Float64
- xc :: Float64
- yc :: Float64
- length :: Float64
- angle :: Float64
- loc :: T where T <: AbstractString
- function Panel2D(xs, ys, xe, ye)
- xc, yc = (xe + xs)/2.0, (ye + ys)/2.0
- length = mag([ xe - xs, ye - ys ])
- angle = xe <= xs ? acos((ye - ys)/length) : π + acos(-(ye - ys)/length)
- loc = angle <= π ? "upper" : "lower"
- new(xs, ys, xe, ye, xc, yc, length, angle, loc)
- end
- end
- mutable struct SourcePanel2D <: Panel2D
- panel :: Panel2D
- strength :: Float64
- vt :: Float64
- cp :: Float64
- function SourcePanel2D(panel, strength=0.0, vt=0.0, cp=0.0)
- new(panel, strength, vt, cp)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement