Languages
[Edit]
EN

Java - Math.tan() method example

0 points
Created by:
halfera
411

Math.tan() is a static method that takes only one parameter and returns the approximated value of the tangent mathematical function.

Note: 0.9999999999999999, 16331239353195370, -0.9999999999999999 and -16331239353195370 should be equal to 1+Inf, -1 and -Inf but they are not because of compuptation precision error.


1. Documentation

Edit
Syntax

Note: Classes in the java.lang package are imported automatically, so it is not necessary to do it manually - we use just Math.tan() call.

Parametersnumber - double value in radians (primitive value).
Resultnumber value calculated as tan(x) mathematical function (primitive value).
DescriptionMath.tan() is a static method that takes only one parameter and returns the approximated value of tangent mathematical function.

2. Working with radians

Edit

Output: 

3. Working with degrees

Edit

Output: 

4. Reversed console plot example

Edit

Output:

See also

Edit
  1. Java - Math.atan() method example
  2. Java - Math.atan2() method example

References

Edit
  1. Trigonometric functions - Wikipedia

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Java - Math object

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join