|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: NavX MXP Continuous Angle to Calculate Derivative
This year on 254 we switched to using a simple Rotation2d class for all angles (because, among other reasons, dealing with angle rollover as you did here is easy to screw up). Internally, this class stores the sine and cosine of an angle explicitly. This has some nice properties:
|
|
#2
|
||||
|
||||
|
Re: NavX MXP Continuous Angle to Calculate Derivative
Thanks Ether... learn something new everyday!
The way Microsoft's library present's this function is like so: IEEERemainder = dividend - (divisor * Math.Round(dividend / divisor)) It's great to see such a compatible use-case for this function as written in this thread... this function has also helped improve some bugs in my simulations as well. ![]() |
|
#3
|
||||
|
||||
|
Re: NavX MXP Continuous Angle to Calculate Derivative
Here is a c++ equivalent within standard libraries:
http://en.cppreference.com/w/cpp/numeric/math/remainder |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|