Orbital elements: Difference between revisions

Content added Content deleted
m (→‎{{header|J}}: try to be less misleading for the unexperienced eye)
m (→‎{{header|J}}: move parameter declaration to opening line)
Line 746: Line 746:
norm=: % %:@X~
norm=: % %:@X~


orbitalStateVectors=: {{
orbitalStateVectors=: {{ 'a e i Om w f'=. y
NB. a: semi-major axis
NB. a: semi-major axis
NB. e: eccentricity
NB. e: eccentricity
Line 753: Line 753:
NB. w: argument of Periapsis (the other "omega")
NB. w: argument of Periapsis (the other "omega")
NB. f: true anomaly
NB. f: true anomaly
'a e i Om w f'=. y
L=. a*2:`]@.*1-*:e
L=. a*2:`]@.*1-*:e
'c s'=. 2{.,F=. 2 R f
'c s'=. 2{.,F=. 2 R f
Line 760: Line 759:
ijk=. F X (2 R w)X(0 R i)X(2 R Om)
ijk=. F X (2 R w)X(0 R i)X(2 R Om)
position=. ra*{.ijk
position=. ra*{.ijk
speed=. (%:(2%ra)-%a)*norm (rp,ra,0) X ijk
speed=. (%:(2%ra)-%a)*norm(rp,ra,0) X ijk
position,:speed
position,:speed
}}</lang>
}}</lang>