From 29e52544d389f88a4af836ae1d82b838ed7a10c7 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Thu, 31 Dec 2020 14:23:45 +0000 Subject: Fix texture loading. Add log overlay --- src/main/kotlin/Extensions.kt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/main/kotlin/Extensions.kt') diff --git a/src/main/kotlin/Extensions.kt b/src/main/kotlin/Extensions.kt index 8c11af1..5678a48 100644 --- a/src/main/kotlin/Extensions.kt +++ b/src/main/kotlin/Extensions.kt @@ -1,11 +1,9 @@ -fun Double.sine(): Double { - return kotlin.math.sin(toRadians(this)) -} +fun Double.toRadians() = this * kotlin.math.PI / 180 -fun Double.cosine(): Double { - return kotlin.math.cos(toRadians(this)) -} +fun Double.sine() = kotlin.math.sin(this.toRadians()) -fun Double.toFlooredInt(): Int { - return kotlin.math.floor(this).toInt() -} \ No newline at end of file +fun Double.cosine() = kotlin.math.cos(this.toRadians()) + +fun Double.toFlooredInt() = kotlin.math.floor(this).toInt() + +fun Double.toRoundedString() = this.asDynamic().toFixed(2) as String \ No newline at end of file -- cgit v1.2.3