Skip to content

Commit

Permalink
package name to com.inasweaterpoorlyknit.noopmath
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucodivo committed Feb 15, 2024
1 parent a4242e2 commit 41d35d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.inasweaterpoorlyknit
package com.inasweaterpoorlyknit.noopmath

import kotlin.math.PI
import kotlin.math.abs
Expand All @@ -15,8 +15,8 @@ const val radiansPerDegree = PI / 180.0
fun Double.degToRad(): Double = this * radiansPerDegree
fun Float.degToRad(): Float = this * radiansPerDegree.toFloat()

fun max(a: Float, b: Float) = if(a > b) { a } else { b }
fun min(a: Float, b: Float) = if(a < b) { a } else { b }
fun max(a: Float, b: Float) = if(a > b) a else b
fun min(a: Float, b: Float) = if(a < b) a else b
fun clamp(value: Double, min: Double, max: Double) = if (value < min) { min } else if (value > max) { max } else { value }
fun clamp(value: Float, min: Float, max: Float) = if (value < min) { min } else if (value > max) { max } else { value }
fun lerp(x: Float, y: Float, a: Float) = x * (1.0f - a) + (y * a)
Expand Down Expand Up @@ -389,4 +389,4 @@ class Mat4 {
override fun equals(other: Any?) = other is Mat4 && this.elements.contentEquals(other.elements)
override fun hashCode() = elements.contentHashCode()
override fun toString() = "Mat4(${elements.contentToString()})"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.inasweaterpoorlyknit
package com.inasweaterpoorlyknit.noopmath

import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down

0 comments on commit 41d35d2

Please sign in to comment.