aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-06-03 15:10:30 +0200
committernea <nea@nea.moe>2023-06-03 15:10:30 +0200
commitd2d032ba05dd476d7edc0038f8a5f60f98769256 (patch)
tree2a8f91f5aa2e7073af67ee14e42ffdd36a0b6aa8 /src/test/kotlin
parentb3237fe53d4ff838984d65954772cf77588644ae (diff)
downloadFirmament-d2d032ba05dd476d7edc0038f8a5f60f98769256.tar.gz
Firmament-d2d032ba05dd476d7edc0038f8a5f60f98769256.tar.bz2
Firmament-d2d032ba05dd476d7edc0038f8a5f60f98769256.zip
Remove old test
Diffstat (limited to 'src/test/kotlin')
-rw-r--r--src/test/kotlin/AngleTest.kt46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/test/kotlin/AngleTest.kt b/src/test/kotlin/AngleTest.kt
deleted file mode 100644
index ac28040..0000000
--- a/src/test/kotlin/AngleTest.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Firmament is a Hypixel Skyblock mod for modern Minecraft versions
- * Copyright (C) 2023 Linnea Gräf
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- */
-
-import kotlin.math.atan
-
-private fun calculateAngleFromOffsets(xOffset: Double, zOffset: Double): Double {
- var angleX = Math.toDegrees(Math.acos(xOffset / 0.04f))
- var angleZ = Math.toDegrees(Math.asin(zOffset / 0.04f))
- if (xOffset < 0) {
- angleZ = 180 - angleZ
- }
- if (zOffset < 0) {
- angleX = 360 - angleX
- }
- angleX %= 360.0
- angleZ %= 360.0
- if (angleX < 0) angleX += 360.0
- if (angleZ < 0) angleZ += 360.0
- var dist = angleX - angleZ
- if (dist < -180) dist += 360.0
- if (dist > 180) dist -= 360.0
- return angleZ + dist / 2
-}
-
-fun main() {
- for(i in 0..10) {
- for (j in 0..10) {
- println("${calculateAngleFromOffsets(i.toDouble(),j.toDouble())} ${atan(i.toDouble() / j.toDouble())}")
- }
- }
-}