Orbital elements: Difference between revisions

m
→‎version 2: fixed a typo, used a more idiomatic expression for numeric digits expression.
m (→‎version 2: aligned some statements, added whitespace.)
m (→‎version 2: fixed a typo, used a more idiomatic expression for numeric digits expression.)
Line 939:
Translation of REXX version 1.
<lang rexx>/*REXX pgm converts orbital elements ──► orbital state vectors (angles are in radians).*/
numeric digits length( pi() ) - 1 length(.) /*limited to pi len, but show 1/3 digs.*/
parse value orbV(1, .1, 0, 355/(113*6), 0, 0) with position '~' speed
say ' position:' show(position)
Line 953:
else L= 1 - eccentricity**2
L= L * semiMaj /*calculate the semi─latus rectum.*/
c= cos(anomaly); s= sin(anomaly) /*calculate COS and SIN of anomolyanomaly*/
r= L / (1 + eccentricity * c)
@= s*r**2 / L; speed= MA(i, @*c - r*s, j, @*s + r*c)