Thanks to the hard work of Gus Jansson of HiTechnic, you can now do sin, cos and atan2, all from the comfort of your NXT-G programming environment! How cool is that? Just go to this page and scroll to the bottom. There are integer versions for NXT-G 1.0 and floating point ones for NXT-G 2.0. They’re proper NXT-G blocks and really fast, much faster than any MyBlock versions that have been cobbled together before.
I was able to test these blocks a few days ago and they work wonderfully with the Rotacaster omniwheels! I’ve been working on some example programs for the One Kit Omniwheel and I’ll post some over the next few days so you can get an idea of how to use them.
[…] http://mightor.wordpress.com/2011/01/14/do-you-like-nxt-g-and-trig/ http://fb.me/Mr9Lax51 # […]
Have you checked the relative speed of integer and FP version?
I have not. Gus told me that the FP one takes approx 0.78ms per calculation, so not bad at all.
The integer version only a little faster. Maybe about .5 ms instead of .74 (for radians). Basically the math of the integer version is a lot messier so it negates any of the benefits of integer math begin faster than floating point math. There are no lookup tables and it is all done my polynomial series, which is easy with floating point math and a pain with integer math.