Java Reference
In-Depth Information
Method
Function
Argument Type
Result Type
tan(arg)
tangent of the
argument
double in radians
double
asin(arg)
sin -1 (arc sine) of the
argument
double
double in
radians with
values from
-
π
/2 to
π
/2.
acos(arg)
cos -1 (arc cosine) of the
argument
double
double in
radians, with
values from 0.0
to
π
.
atan(arg)
tan -1 (arc tangent) of
the argument
double
double in
radians with
values from
-
π
/2 to
π
/2.
atan2 (arg1,arg2)
tan -1 (arc tangent) of
arg1/arg2
Both double
double in
radians with
values from
-
π
to
π
.
As with all methods, the arguments that you put between the parentheses following the method name
can be any expression that produces a value of the required type. If you are not familiar with these
trigonometric operations you can safely ignore them.
You also have a range of useful numerical functions that are implemented in the class Math . These are:
Method
Function
Argument type
Result type
abs(arg)
Calculates the absolute
value of the argument
int , long ,
float , or double
The same type as
the argument
max (arg1,arg2)
Returns the larger of
the two arguments,
both of the same type
int , long ,
float , or double
The same type as
the argument
min (arg1,arg2)
Returns the smaller of
the two arguments,
both of the same type
int , long ,
float , or double
The same type as
the argument
ceil(arg)
Returns the smallest
integer that is greater
than or equal to the
argument
double
double
floor(arg)
Returns the largest
integer that is less than
or equal to the
argument
double
double
Search WWH ::




Custom Search