Download or view fitPlutoOrbit.frink in plain text format
/** This is an attempt to find generalized ellipse equation that matches
Pluto's orbit. For now, we're ignoring the latitude and only plotting
the longitude.
*/
use planets.frink
use fitConicSection.frink
start = #1886#
end = #2098#
timestep = (end-start) / 4
args = new array
t = start
while t <= end
{
[L,B,R] = Planet.Pluto.getCoordinates[t]
[x,y,z] = heliocentricToXYZ[L,B,R]
args.push[x]
args.push[y]
t = t + timestep
}
//println[args]
[x1,y1,x2,y2,x3,y3,x4,y4,x5,y5] = divide[args, au]
println[fitPointsToText[x1,y1,x2,y2,x3,y3,x4,y4,x5,y5]]
funcs = fitPointsToYFunctions[x1,y1,x2,y2,x3,y3,x4,y4,x5,y5]
println[formatTable[mapList["inputForm", funcs], "right"]]
g = plotPoints[x1,y1,x2,y2,x3,y3,x4,y4,x5,y5]
[L,B,R] = Planet.Pluto.getCoordinates[now[]]
println["L=" + (L->deg) + "B=" + (B->deg) + "R=$R"]
[x,y,z] = divide[heliocentricToXYZ[L,B,R], au]
println["x=$x, y=$y, z=$z"]
g.color[0,1,0,.7]
g.fillEllipseCenter[x, -y, 1, 1]
g.show[]
Download or view fitPlutoOrbit.frink in plain text format
This is a program written in the programming language Frink.
For more information, view the Frink
Documentation or see More Sample Frink Programs.
Alan Eliasen, eliasen@mindspring.com