Package 

Class MyMath

  • All Implemented Interfaces:
    org.osmdroid.views.util.constants.MathConstants

    
    public class MyMath
     implements MathConstants
                        
    • Method Summary

      Modifier and Type Method Description
      static double gudermannInverse(double aLatitude)
      static double gudermann(double y)
      static int mod(int number, int modulus)
      static long floorToLong(double pValue) Casting a _negative_ double into a long has a counter-intuitive result.E.g.
      static int floorToInt(double pValue)
      static int getNextSquareNumberAbove(float factor)
      static double getAngleDifference(double pStart, double pEnd, Boolean pClockwise)
      static double cleanPositiveAngle(double pAngle)
      static double computeAngle(long pX1, long pY1, long pX2, long pY2)
      static void computeCirclePoint(long pCenterX, long pCenterY, double pRadius, double pAngle, PointL pOutput)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • gudermann

         static double gudermann(double y)
      • mod

         static int mod(int number, int modulus)
      • floorToLong

         static long floorToLong(double pValue)

        Casting a _negative_ double into a long has a counter-intuitive result.E.g. (long)(-0.4) = 0, though -1 would be expected.Math.floor would be the answer, but I assume we could go faster than (long)Math.floor

      • floorToInt

         static int floorToInt(double pValue)
      • getAngleDifference

         static double getAngleDifference(double pStart, double pEnd, Boolean pClockwise)
        Parameters:
        pStart - start angle
        pEnd - end angle
        pClockwise - if null, get the smallest difference (in absolute value)if true, go clockwiseif false, go anticlockwise
      • cleanPositiveAngle

         static double cleanPositiveAngle(double pAngle)
        Parameters:
        pAngle - angle in degree
      • computeAngle

         static double computeAngle(long pX1, long pY1, long pX2, long pY2)
      • computeCirclePoint

         static void computeCirclePoint(long pCenterX, long pCenterY, double pRadius, double pAngle, PointL pOutput)
        Parameters:
        pAngle - clockwise angle, in radian, value 0 being 3 o'clock