public class ShapeUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static double |
FIFTH_CIRCLE
The number of radians corresponding to one-fifth of a circle
|
private static java.util.HashMap<java.lang.Integer,double[][]> |
NGON_POINTS |
private static double[][] |
STAR_PENT_POINTS
The inner pentagon points of the unit star
|
private static double[][] |
STAR_TIP_POINTS
The outer tip points of the unit star
|
Constructor and Description |
---|
ShapeUtil() |
Modifier and Type | Method and Description |
---|---|
static double[][] |
getNGonPoints(int n,
double[] tl,
double[] br,
double[] center)
Calculates the points of an N-gon
|
static double[][] |
getStarPentPoints(double[] tl,
double[] br,
double[] center)
Calculates the inner points of a star
|
static double[][] |
getStarTipPoints(double[] tl,
double[] br,
double[] center)
Calculates the outer points of a star
|
private static final double FIFTH_CIRCLE
private static final double[][] STAR_PENT_POINTS
private static final double[][] STAR_TIP_POINTS
private static final java.util.HashMap<java.lang.Integer,double[][]> NGON_POINTS
public static double[][] getStarPentPoints(double[] tl, double[] br, double[] center)
tl
- the top left corner of the shapebr
- the bottom right corner of the shapecenter
- the center point of the shaperpublic static double[][] getStarTipPoints(double[] tl, double[] br, double[] center)
tl
- the top left corner of the shapebr
- the bottom right corner of the shapecenter
- the center point of the shaperpublic static double[][] getNGonPoints(int n, double[] tl, double[] br, double[] center)
n
- the number of sidestl
- the top left corner of the shapebr
- the bottom right corner of the shapecenter
- the center point of the shape