-
Notifications
You must be signed in to change notification settings - Fork 123
VRageMath.MathHelper.MonotonicCosine
← Index ← MathHelper
csharp[float](System.Single) MonotonicCosine([float](System.Single) radians)##### Summary
Calculate the monotonic cosine of a value. Monotonic cosine is an alternative cosine encoding that is monotonic in the [-pi, pi] interval. We use this when some parameter of an onject in a planet is constrained by latitude. The 'monotonicity' is guaranteed by subtracting the cosine value from 2 if the angle is positive. So for instance MonotonicCos(pi/2) = 2. This only works in the above interval of course.
The cosine of the angle if it is > 0, 2 - that value otherwise.
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!