View Single Post
  #7   Spotlight this post!  
Unread 22-05-2016, 13:41
Richard100 Richard100 is offline
Registered User
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Southern Maryland
Posts: 79
Richard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to behold
Re: NavX MXP Continuous Angle to Calculate Derivative

Quote:
Originally Posted by Ether View Post
Look at the Endnote at the bottom of the last page.


The Endnote LV code you reference is functionally equivalent to shortest_angle = (present-previous) - 360*floor(0.5+(present-previous)/360); provided here ...
Quote:
Originally Posted by Ether View Post

If your language does not support IEEERemainder, you can use this one-line function instead:
Code:
shortest_angle = (present-previous) - 360*floor(0.5+(present-previous)/360);
Both can be written in LV by building up the function from other primitive programming functions (as you depict in the endnote image).

What I wanted to know was whether LabVIEW has IEEERemainder as a programming function (call it Rem). There is a Mod (%) function (known in LV as Quotient & Remainder), but of course Rem and Mod differ in how they internally round, which is what makes Rem useful here.

Same question as you asked here, only for the LabVIEW language. Equivalent to asking: Can it be done in LabVIEW "... with one line of code".

Any LabVIEW experts know? If not, might this be in the development pipeline?
Reply With Quote