-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Compute sun and moon positions #677
Changes from 21 commits
a13745e
fab8f1c
2c893a1
3bad847
0e219c5
75fcac4
9e52045
77e7116
7a44268
1b0ab53
927ea78
e130bde
35201b6
6bb9d2d
57284fe
dc2b76e
24ff9d5
508f45d
933c043
2840e56
d728d27
8815db0
336dfa6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -397,7 +397,7 @@ define([ | |
}; | ||
|
||
/** | ||
* Alters the value of input x such that <code>-CesiumMath.PI</code> <= x <= <code>CesiumMath.PI</code> | ||
* Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle. | ||
* @param {Number} angle in radians | ||
* @return {Number} The angle in the range ()<code>-CesiumMath.PI</code>, <code>CesiumMath.PI</code>). | ||
*/ | ||
|
@@ -417,6 +417,18 @@ define([ | |
return x > pi ? pi : x; | ||
}; | ||
|
||
/** | ||
* Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle. | ||
* @param {Number} angle in radians | ||
* @return {Number} The angle in the range (0 , <code>CesiumMath.TWO_PI</code>). | ||
*/ | ||
CesiumMath.zeroToTwoPi = function(x) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Saying it "alters" the value of input x is a bit misleading. It's ok to just copy the doc right out of Components. The comment in the code in Components about the second modulus is useful as well (even if it's mispelled modules). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I copied the doc from the existing negativePiToPi function right above this one. I'll change the doc for both. |
||
var value = x % CesiumMath.TWO_PI; | ||
// We do a second modules here if we add 2Pi to ensure that we don't have any numerical issues with very | ||
// small negative values. | ||
return (value < 0.0) ? (value + CesiumMath.TWO_PI) % CesiumMath.TWO_PI : value; | ||
}; | ||
|
||
/** | ||
* DOC_TBA | ||
*/ | ||
|
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.
Need to remove this, too, since it called the other one.