unit untheleg ; { parameters p' e' s' 1-c' a' r' n' } interface { and angles v' E' g' h' for giant planet } { giant planet heliocentric ecliptic parameters to array parall[..] angles to array argall[..] number of main planet in global plaman from untypvar } procedure giparargum ( t : extended ) ; { for moment t in julian day } implementation uses unsagcot , { types constants } untypvar , { types variables } unephjpl , { variables FactorMuZ[..] } ungephem , { procedure for ephemeris } unforkep , { function KeplerEquation } unforfun ; { simple function datan2 } { giant planet heliocentric ecliptic parameters to array parall[..] angles to array argall[..] number of main planet in global plaman from untypvar } procedure giparargum ( t : extended ) ; { for moment t in julian day } var p : tvect3 ; { positional ecliptic heliocentric elements } u : tvect3 ; { angle ecliptic heliocentric elements \O \o M } a : extended ; { semimajor axis i AU } e : extended ; { eccentricity } s : extended ; { inclination in radian and sin(v) } c : extended ; { cos(v) } q : extended ; { eccentric anomaly from kepler equation } v : extended ; { true anomaly v in radian } begin { the main planet heliocentric ecliptic } forgianel(plaman,t,p,u); { ungephem kepler elements } a:=p[1]; { semimajor axis in AU } e:=p[2]; { eccenricity } s:=grarad*p[3]; { inclination in radian } { parameters parall[..] angles argall[..] } parall[10]:=a; { parameter a' giant planet semimajor axis AU } parall[14]:=Sqrt(FactorMuZ[plaman]/(a*a*a)); {n' in radian per day } parall[6]:=e; { parameter e' giant planet eccentricity } parall[5]:=1/sqrt(1.0-sqr(e)); { parameter p' giant planet } parall[7]:=sin(s); { parameter s'=sin(i') giant planet } parall[8]:=1.0-cos(s); { parameter 1-cos(i') giant planet } { for angle variables constants from unsagcot } argall[8]:=grarad*(u[1]-90.0); { angle h' giant planet \Omega-90 } argall[7]:=grarad*(u[2]+90.0); { angle g' giant planet \omega+90 } q:=KeplerEquation(e,grarad*u[3]); { unforkep angle E in radian } argall[6]:=q; { angle E' giant planet eccentric anomaly } parall[12]:=a*(1.0-e*cos(q)); { parameter r' giant planet range } s:=sqrt(1.0-e*e)*sin(q); { part of sin(v) true anomaly } c:=cos(q)-e; { part of cos(v) true anomaly } v:=DATan2(s,c); { true anomaly value UnForFun } argall[5]:=v; { angle v' giant planet true anomaly } end; end.