Java Reference
In-Depth Information
Table 23-1
Trigonometric Method in Math and StrictMath Classes
RETURNS
METHOD/ACTION
staticdouble sin(double a)
Returns the trigonometricsine of an angle
staticdouble cos(double a)
Returns the trigonometriccosine of an angle
staticdouble
tan(double a)
Returns the trigonometrictangent of an angle
staticdouble
asin(double a)
Returns the arcsine of an angle, in the range
-
π
/2 through
π
/2
staticdouble
acos(double a)
Returns the arccosine of an angle, in the
range of 0.0 through
π
staticdouble
atan(double a)
Returns the arctangent of an angle, in the
range of -
π
/2 through
π
/2
staticdouble
atan2(double a, double b)
Converts rectangular coordinates (b, a) to
polar (r,
)
θ
staticdouble
t oDegrees(double angrad)
Converts an angle measured in radians to the
equivalent angle measured in degrees
staticdouble
toRadians(double angdeg)
Converts an angle measured in degrees to
the equivalent angle measured in radians
and the corresponding arc functions:
1
1
1
sec
Θ=
cos
Θ
1
csc
1
Θ=
cos
1
Θ
1
cot
1
Θ=
tan
1
Θ
Calculating trigonometric functions
The trigonometric functions in java.lang.Math receive as input an angle in
radians. If input is in degrees,user code can convert to radians by calling
the toRadians() method. By the same token,the trigonometric arc-func -
 
Search WWH ::




Custom Search