public class MathUtils
extends java.lang.Object
Math
utility functions.Modifier and Type | Method and Description |
---|---|
static int |
ccw(int x0,
int y0,
int x1,
int y1,
int x2,
int y2)
Performs a counter clockwise test that specifies whether a point p2 (x2,y2) is left (counter clockwise) or
right (clockwise) to a vector p0p1.
|
static int |
ccw(java.awt.Point p0,
java.awt.Point p1,
java.awt.Point p2)
Performs a counter clockwise test that specifies whether a point p2 is left (counter clockwise) or right (clockwise) to a vector p0p1.
|
static java.lang.String |
formatDouble(double value)
Formats a double value.
|
static java.lang.String |
formatFloat(float value)
Formats a float value.
|
static int |
max(int... values)
Gets the maximum value of a set of values.
|
public static java.lang.String formatFloat(float value)
value
- the float valuepublic static java.lang.String formatDouble(double value)
value
- the double valuepublic static int max(int... values)
values
- the set of valuespublic static int ccw(int x0, int y0, int x1, int y1, int x2, int y2)
x0
- the x position of point p0y0
- the y position of point p0x1
- the x position of point p1y1
- the y position of point p1x2
- the x position of point p2y2
- the y position of point p20
if p2 is collinear to vec(p0p1), > 0
if p2 is at the left side of vec(p0p1) (counter clockwise) or < 0
if p2 is at the right side of vec(p0p1) (clockwise)public static int ccw(java.awt.Point p0, java.awt.Point p1, java.awt.Point p2)
p0
- the point p0p1
- the point p1p2
- the point p20
if p2 is collinear to vec(p0p1), > 0
if p2 is at the left side of vec(p0p1) (counter clockwise) or < 0
if p2 is at the right side of vec(p0p1) (clockwise)