-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draw sublunar point on ptr world map #139
base: dev
Are you sure you want to change the base?
Conversation
currently using a questionable algorithim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Big math behind it. Good for you for crushing it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had approved before, but the moon isn't moving.
const normalizedM = rev(M + 129 * 360); | ||
|
||
// Compute eccentric anomaly (E) | ||
let E0 = normalizedM + (180 / Math.PI) * e * Math.sin(normalizedM) * (1 + e * Math.cos(normalizedM)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought javascript Math.sin() etc used radians rather than degrees
const E = E1; | ||
|
||
// Rectangular coordinates in the plane of the lunar orbit | ||
const x = a * (Math.cos(degToRad * E) - e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this looks right - converting degrees to radians before taking the cosine
Ah I see why it's not working. This formula gives ecliptic longitude and latitude when I need to get earth coordinates. Will look for a formula for that or ask Tim again. |
it dont work, also I've never clicked this button so want to see what it does
Draws the moon to the world map on the ptr home screen
using an good enough equation supplied by Tim Lister -> https://stjarnhimlen.se/comp/tutorial.html#7.
Tested against this website to check accuracy -> https://www.timeanddate.com/worldclock/sunearth.php
Hard to test since I don't understand the math too much, so will keep an eye on it for a week to make sure it stays accurate and no errors come up.