Kotlin atan()
Anonymous contributor
Published Oct 19, 2023
Contribute to Docs
The atan() method in Kotlin’s math class is used to calculate the arc tangent of a value. It returns the value of the angle in the range from -PI/2 to PI/2 radians.
Syntax
atan(x)
x: The number for which the arc tangent is to be calculated.
The atan() method returns a value of type double or float depending also on the type of the input respectively. If the argument passed is NaN, the method will return NaN.
Example
This example shows how to use the atan() method to calculate the arc tangent of 90.0:
import kotlin.math.*fun main(){println(atan(90.0))}
The output of this code will be:
1.5596856728972892
All contributors
- Anonymous contributor
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Kotlin on Codecademy
- Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
- Includes 6 Courses
- With Professional Certification
- Beginner Friendly.75 hours
- Learn Kotlin, the expressive, open-source programming language developed by JetBrains.
- Beginner Friendly.9 hours