Orbital elements: Difference between revisions
Content added Content deleted
m (→{{header|J}}: put that comma where it was originally supposed to be) |
m (→{{header|J}}) |
||
Line 752: | Line 752: | ||
NB. Om: Longitude of the ascending node |
NB. Om: Longitude of the ascending node |
||
NB. w: argument of Periapsis (the other "omega") |
NB. w: argument of Periapsis (the other "omega") |
||
NB. f: true anomaly |
NB. f: true anomaly (varies with time) |
||
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 762: | Line 762: | ||
position,:speed |
position,:speed |
||
}}</lang> |
}}</lang> |
||
The true anomaly, argument of Periapsis, Longitude of the ascending node and inclination are all angles. And we use the dot product of their rotation matrices (in that order) to find the orientation of the orbit and the object's position in that orbit. Here, <code>R</code> finds the rotation matrix for a given angle around a given axis. Here's an example of what R gives us for a sixty degree angle: |
|||
<lang J> 0 1 2 R&.> 60r180p1 NB. rotate around first, second or third axis |
|||
┌────────────────────┬────────────────────┬────────────────────┐ |
|||
│1 0 0│ 0.5 0 _0.866025│ 0.5 0.866025 0│ |
|||
│0 0.5 0.866025│ 0 1 0│_0.866025 0.5 0│ |
|||
│0 _0.866025 0.5│0.866025 0 0.5│ 0 0 1│ |
|||
└────────────────────┴────────────────────┴────────────────────┘</lang> |
|||
Task example:<lang J> orbitalStateVectors 1 0.1 0 355r678 0 0 |
Task example:<lang J> orbitalStateVectors 1 0.1 0 355r678 0 0 |