Package fr.formiko.kokcinelo.tools
Class Math
java.lang.Object
fr.formiko.kokcinelo.tools.Math
Math tools class with usefull static functions.
- Since:
- 0.1
- Version:
- 1.3
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.getSegmentIntersectionAngles
(com.badlogic.gdx.math.Vector2 circleCenter, float circleRadius, com.badlogic.gdx.math.Vector2 pointA, com.badlogic.gdx.math.Vector2 pointB)
-
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 pointy1
- y of 1a pointx2
- x of 2a pointy2
- 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 pointy1
- y of 1a pointx2
- x of 2a pointy2
- 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 pointy1
- y of 1a pointx2
- x of 2a pointy2
- 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 valuemax
- the maximum valueval
- 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 valuemax
- the maximum valueval
- 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 valuemax
- the maximum valueval
- 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 valuemax
- the maximum valueval
- 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 valuemax
- the maximum valueval
- the value to test- Returns:
- val or a bound
-
getSegmentIntersectionAngles
-
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)
-