asin()
Published Oct 29, 2023
Contribute to Docs
The asin()
function returns the arcsine of a number.
Syntax
asin(x)
The function accepts one mandatory parameter x
. It should be a numeric value in the range between -1
and 1
(inclusive). The argument can be of Double
, and Float
datatype.
It returns the arcsine of the argument, which represents an angle in radians. The return value will be of the same type as the argument.
Example
The example below demonstrates how to use asin() method to return the arcsine of 0.5
.
import kotlin.math.asinfun main() {// Calculate the arcsine of 0.5val result = asin(0.5)// Print the resultprintln(result)}
The output will be:
0.5235987755982989
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
- Career path
Computer Science
Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!Includes 6 CoursesWith Professional CertificationBeginner Friendly75 hours - Free course
Learn Kotlin
Learn Kotlin, the expressive, open-source programming language developed by JetBrains.Beginner Friendly9 hours