This discussion is archived
0 Replies Latest reply: Nov 27, 2011 10:54 PM by user8478974 RSS

Inverse trigonmetric functions and MIDP

user8478974 Newbie
Currently Being Moderated
The inverse (arc) trigonometric functions, which are static methods of the java.lang.Math class, are not included in MIDP. This seems arbitrary to me, since MIDP is used in robotics (viz. the SunSPOT), navigation is important in robotics, navigation requires working with angles, and the inverse trigonometric functions are the only functions that return an angle supported by the Math class. For instance, the angle between two vectors can be computed using arctan() or arctan2().

I have worked around this problem by implementing arctan2 using the CORDIC algorithm (see http://en.wikipedia.org/wiki/CORDIC). Yet, I am still perplexed by the decision of leaving the inverse trigonometric functions out of MIDP. Can anyone provide the rationale? Is there a library class that provide these functions?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points