Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    \$\begingroup\$ Set k=a*(1-e*e) to be reused in r and t. Divide 10 in r to remove *0.01 in t. \$\endgroup\$ Commented Jul 19, 2024 at 5:04
  • \$\begingroup\$ @akamayu k is now being used, but p=a-a*e*e is now available for a total savings of 6 bytes \$\endgroup\$ Commented Jul 20, 2024 at 23:15
  • 1
    \$\begingroup\$ @guest4308 Explanation in 1 hour, golfing tomorrow. The change from a*(1-e*e) to (a-a*e*e) will help combine the formulas where r is calculated & used into one, eliminating need for r and the proposed k. I've introduced k for a different purpose since akamayu's comment, to record longitude of 1st point plotted. By checking k against longitude at start of each new orbit (within a margin) the iterations are stopped if the ground track starts to repeat (LCM of orbit and planet rotation period.) I've changed some variable names (including removal of p) to facilitate explanation. \$\endgroup\$ Commented Jul 20, 2024 at 23:33
  • \$\begingroup\$ @LevelRiverSt it looks to me like the -6 bytes works with your code and with your explanation; what was the problem with it? \$\endgroup\$ Commented Jul 21, 2024 at 8:30
  • 1
    \$\begingroup\$ @guest4308 combining the formulas that generate and use r into one is a bigger saving t+=d*((a-a*e*e)**3/u)**0.5/(1+e*Math.cos(v+=d))**2 . I am trying out several golf ideas and will post the golfed version in about 12 hours (as I have other things to do today) in addition to the ungolfed version. \$\endgroup\$ Commented Jul 21, 2024 at 9:02