Skip to content

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Apr 22, 2013

Resolves: #391 #337

Ported parts of Simon1994PlanetaryPositions, KeplarianElements and ModifiedKeplarianElements from components to compute the sun and moon positions. Updated UniformState to use the new sun and moon positions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just skip this, because rotating a vector by identity results in the same vector.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to include the full exception message from Components: "The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola." Yeah, I don't really know what that means, either. Also it shouldn't ever happen for the Simon model. But there's no reason not to throw the better error message if you're going to check for it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate to say it, but there's an allocation here that needs to be changed to use a result parameter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. Kepler's equation is going to converge for the reasonable orbits of the Earth-moon barycenter and the Moon. At least it better! Since we'll probably never do it, let's change this TODO to just a regular explanation comment: "STK Components uses a numerical method to find the eccentric anomaly in the case that Kepler's equation does not converge. We don't expect that to ever be necessary for the reasonable orbits used here." We try to avoid TODOs in master (though there are some), instead preferring GitHub issues for thing we might actually do, and comments of explanation for things we probably won't.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Earth-centered inertial frame" here, too.

@hpinkos
Copy link
Contributor Author

hpinkos commented Apr 25, 2013

@kring anything else? Your diff comments above got off by a few lines, but I think I caught everything you mentioned.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove this, too, since it called the other one.

@kring
Copy link
Member

kring commented Apr 25, 2013

Almost done, just those couple of things left. Thanks for your patience with my endless comments.

@hpinkos
Copy link
Contributor Author

hpinkos commented Apr 25, 2013

@kring I appreciate your thoroughness. Anything else?

@kring
Copy link
Member

kring commented Apr 25, 2013

Tests pass, Sandcastle examples look good (especially the terrain one where you can see the sun and moon specular highlight), jsHint is happy. Code looks allocation-free!

Just one last problem, I promise! I just noticed that Simon1994PlanetaryPositions shows up as just PlanetaryPositions in the doc. You at least need to change the @exports line at the top, and possible rename var PlanetaryPositions as well - probably not a bad idea to do that whether you need to or not, actually, just for consistency.

@mramato
Copy link
Contributor

mramato commented Apr 26, 2013

@hpinkos just an FYI; we don't get automatic notification to every change, so when you are done with review comments, it's usually a good idea to write a quick "ready for another review" message. Otherwise @kring wouldn't know you finished the rename until he remembers to check. That being said, I'll let him merge this, since he's been the one reviewing it.

@kring
Copy link
Member

kring commented Apr 27, 2013

Looks good. Thanks, @hpinkos! Merging.

kring added a commit that referenced this pull request Apr 27, 2013
Compute sun and moon positions
@kring kring merged commit ed60594 into CesiumGS:master Apr 27, 2013
@hpinkos hpinkos deleted the computeSun branch May 8, 2013 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compute sun position

4 participants