Skip to content

Commit

Permalink
Fix trigonometric extension functions
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousNikhil committed Oct 24, 2021
1 parent bef12dc commit 52f71b0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions k5-compose/src/main/kotlin/math/Trigonometry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ fun Float.cos(): Float {
return cos(this.toRadians())
}

fun Float.atan2(y: Float, x: Float): Float {
fun atan2(y: Float, x: Float): Float {
return kotlin.math.atan2(y.toDouble(), x.toDouble()).toFloat().toRadians()
}

fun Float.atan(ratio: Float): Float {
return kotlin.math.atan(ratio).toRadians()
fun Float.atan(): Float {
return kotlin.math.atan(this).toRadians()
}

fun Float.asin(ratio: Float): Float {
return kotlin.math.asin(ratio).toRadians()
fun Float.asin(): Float {
return kotlin.math.asin(this).toRadians()
}

fun Float.acos(ratio: Float): Float {
return kotlin.math.acos(ratio).toRadians()
fun Float.acos(): Float {
return kotlin.math.acos(this).toRadians()
}

/**
Expand Down

0 comments on commit 52f71b0

Please sign in to comment.