![]() |
No atan() method in FRC version of java
I am trying to program a swerve drive, and I need to use atan(), but netbeans always says it doesn't exist in my class. Yes I know there is getDirection() on the joystick, but I need to manipulate numbers after taking them from the joystick.
Thanks in advance Alex |
Re: No atan() method in FRC version of java
Alex:
Take a look in the com.sun.squawk.util.MathUtils package. There are implementations of many of the J2SE math functions, including atan() and atan2(), in there. |
Re: No atan() method in FRC version of java
Team 20 had the same problem. We ended up writing a Talyor approximation and reflecting it about the axis to produce our own atan2 function.
|
Re: No atan() method in FRC version of java
Quote:
|
Re: No atan() method in FRC version of java
Ok well I figured it out. I needed to call MathUtils.atan(). I wasn't using MathUtils befroe. Thanks for the input though everybody.
|
Re: No atan() method in FRC version of java
What are you using the atan() function for?
If you are going to have negative numbers for the input, it may be better to use atan2(x,y). |
Re: No atan() method in FRC version of java
Quote:
|
Re: No atan() method in FRC version of java
Quote:
Here is the actual function header: Code:
double atan2(double y, double x) ; |
Re: No atan() method in FRC version of java
Quote:
|
Re: No atan() method in FRC version of java
Quote:
See the discussion about ATAN2 nonlinear model fitting here: http://www.chiefdelphi.com/media/papers/2390 |
Re: No atan() method in FRC version of java
Quote:
|
| All times are GMT -5. The time now is 09:36. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi