Class Math

java.lang.Object
fr.formiko.kokcinelo.tools.Math

public class Math extends Object
Math tools class with usefull static functions.
Since:
0.1
Version:
1.3
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte
    between(byte min, byte max, byte val)
    Return a value in an interval.
    static double
    between(double min, double max, double val)
    Return a value in an interval.
    static float
    between(float min, float max, float val)
    Return a value in an interval.
    static int
    between(int min, int max, int val)
    Return a value in an interval.
    static long
    between(long min, long max, long val)
    Return a value in an interval.
    static List<com.badlogic.gdx.math.Vector2>
    getCircleLineIntersectionPoint(com.badlogic.gdx.math.Vector2 pointA, com.badlogic.gdx.math.Vector2 pointB, com.badlogic.gdx.math.Vector2 center, float radius)
     
    static double
    getDistanceBetweenPoints(double x1, double y1, double x2, double y2)
    Return distance between 2 points.
    static double
    getDistanceBetweenPoints(float x1, float y1, float x2, float y2)
    Return distance between 2 points.
    static double
    getDistanceBetweenPoints(int x1, int y1, int x2, int y2)
    Return distance between 2 points.
    static List<Float>
    getSegmentIntersectionAngles(com.badlogic.gdx.math.Vector2 circleCenter, float circleRadius, com.badlogic.gdx.math.Vector2 pointA, com.badlogic.gdx.math.Vector2 pointB)
     

    Methods inherited from class java.lang.Object

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

    • getDistanceBetweenPoints

      public static double getDistanceBetweenPoints(int x1, int y1, int x2, int y2)
      Return distance between 2 points.
      Parameters:
      x1 - x of 1a point
      y1 - y of 1a point
      x2 - x of 2a point
      y2 - y of 2a point
      Returns:
    • getDistanceBetweenPoints

      public static double getDistanceBetweenPoints(float x1, float y1, float x2, float y2)
      Return distance between 2 points.
      Parameters:
      x1 - x of 1a point
      y1 - y of 1a point
      x2 - x of 2a point
      y2 - y of 2a point
      Returns:
    • getDistanceBetweenPoints

      public static double getDistanceBetweenPoints(double x1, double y1, double x2, double y2)
      Return distance between 2 points.
      Parameters:
      x1 - x of 1a point
      y1 - y of 1a point
      x2 - x of 2a point
      y2 - y of 2a point
      Returns:
    • between

      public static int between(int min, int max, int val)
      Return a value in an interval.
      max & min are in the interval.
      Parameters:
      min - the minimum value
      max - the maximum value
      val - the value to test
      Returns:
      val or a bound
    • between

      public static long between(long min, long max, long val)
      Return a value in an interval.
      max & min are in the interval.
      Parameters:
      min - the minimum value
      max - the maximum value
      val - the value to test
      Returns:
      val or a bound
    • between

      public static byte between(byte min, byte max, byte val)
      Return a value in an interval.
      max & min are in the interval.
      Parameters:
      min - the minimum value
      max - the maximum value
      val - the value to test
      Returns:
      val or a bound
    • between

      public static float between(float min, float max, float val)
      Return a value in an interval.
      max & min are in the interval.
      Parameters:
      min - the minimum value
      max - the maximum value
      val - the value to test
      Returns:
      val or a bound
    • between

      public static double between(double min, double max, double val)
      Return a value in an interval.
      max & min are in the interval.
      Parameters:
      min - the minimum value
      max - the maximum value
      val - the value to test
      Returns:
      val or a bound
    • getSegmentIntersectionAngles

      public static List<Float> getSegmentIntersectionAngles(com.badlogic.gdx.math.Vector2 circleCenter, float circleRadius, com.badlogic.gdx.math.Vector2 pointA, com.badlogic.gdx.math.Vector2 pointB)
    • getCircleLineIntersectionPoint

      public static List<com.badlogic.gdx.math.Vector2> getCircleLineIntersectionPoint(com.badlogic.gdx.math.Vector2 pointA, com.badlogic.gdx.math.Vector2 pointB, com.badlogic.gdx.math.Vector2 center, float radius)