summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils
diff options
context:
space:
mode:
authorAntonio Zugaldia <antonio@mapbox.com>2017-02-03 15:12:13 -0500
committerGitHub <noreply@github.com>2017-02-03 15:12:13 -0500
commitc97ec3be0397290e172299c49361f5033270f150 (patch)
treec66ceec30a95c484e5df9fabe1a22d8381bd8b19 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils
parente5c9db47931174911f0403a1f640a5ae33814b60 (diff)
downloadqtlocation-mapboxgl-c97ec3be0397290e172299c49361f5033270f150.tar.gz
[android] Extract telemetry into MAS
* [android] add the mapbox-android-telemetry module dependency. * update javadoc
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MathUtils.java66
1 files changed, 0 insertions, 66 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MathUtils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MathUtils.java
deleted file mode 100644
index 30ec214798..0000000000
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/MathUtils.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package com.mapbox.mapboxsdk.utils;
-
-public class MathUtils {
-
- /**
- * Test a value in specified range, returning minimum if it's below, and maximum if it's above
- *
- * @param value Value to test
- * @param min Minimum value of range
- * @param max Maximum value of range
- * @return value if it's between min and max, min if it's below, max if it's above
- */
- public static double clamp(double value, double min, double max) {
- return Math.max(min, Math.min(max, value));
- }
-
- /**
- * Test a value in specified range, returning minimum if it's below, and maximum if it's above
- *
- * @param value Value to test
- * @param min Minimum value of range
- * @param max Maximum value of range
- * @return value if it's between min and max, min if it's below, max if it's above
- */
- public static float clamp(float value, float min, float max) {
- return Math.max(min, Math.min(max, value));
- }
-
- /**
- * Constrains value to the given range (including min, excluding max) via modular arithmetic.
- * <p>
- * Same formula as used in Core GL (wrap.hpp)
- * std::fmod((std::fmod((value - min), d) + d), d) + min;
- *
- * @param value Value to wrap
- * @param min Minimum value
- * @param max Maximum value
- * @return Wrapped value
- */
- public static double wrap(double value, double min, double max) {
- double delta = max - min;
-
- double firstMod = (value - min) % delta;
- double secondMod = (firstMod + delta) % delta;
-
- return secondMod + min;
- }
-
- /**
- * Convert bearing from core to match Android SDK value.
- *
- * @param nativeBearing bearing value coming from core
- * @return bearing in degrees starting from 0 rotating clockwise
- */
- public static double convertNativeBearing(double nativeBearing) {
- double direction = -nativeBearing;
-
- while (direction > 360) {
- direction -= 360;
- }
- while (direction < 0) {
- direction += 360;
- }
- return direction;
- }
-}