public class GeometryUtils extends Object
| Constructor and Description |
|---|
GeometryUtils() |
| Modifier and Type | Method and Description |
|---|---|
static double[] |
getLinearEquation(double x1,
double y1,
double x2,
double y2)
Calculates the standard line equation for two points.
|
static Point[] |
intersectBezierAndLine(CubicCurve2D curve,
Line2D line)
Calculates the intersection points of a Bezier curve and a line.
|
static Point |
intersectLines(double a1,
double b1,
double c1,
double a2,
double b2,
double c2)
Calculates the intersection point between two lines that are given as
standard line equation.
|
static Point |
intersectLines(double gx1,
double gy1,
double gx2,
double gy2,
double hx1,
double hy1,
double hx2,
double hy2)
Calculates the intersection point between two lines that are given
through two points each.
|
static Point |
intersectLineWithCircle(Ellipse2D circle,
Line2D line)
Calculates the intersection point between a line and a circle.
|
static Shape |
transformShape(Shape shape,
double translateX,
double translateY,
double scale)
Transform the given shape respecting the translate and scale values and
returns the transformed shape.
|
static Shape |
transformShape(Shape shape,
double translateX,
double translateY,
double scaleX,
double scaleY)
Transform the given shape respecting the translate and scale values and
returns the transformed shape.
|
public static double[] getLinearEquation(double x1,
double y1,
double x2,
double y2)
x1 - x-coordinate of the first pointy1 - y-coordinate of the first pointx2 - x-coordinate of the second pointy2 - y-coordinate of the second pointpublic static Point intersectLines(double a1, double b1, double c1, double a2, double b2, double c2)
a1 - parameter of the first line: a1*x + b1*y + c1 = 0b1 - parameter of the first line: a1*x + b1*y + c1 = 0c1 - parameter of the first line: a1*x + b1*y + c1 = 0a2 - parameter of the second line: a2*x + b2*y + c2 = 0b2 - parameter of the second line: a2*x + b2*y + c2 = 0c2 - parameter of the second line: a2*x + b2*y + c2 = 0public static Point intersectLines(double gx1, double gy1, double gx2, double gy2, double hx1, double hy1, double hx2, double hy2)
gx1 - x-coordinate of the first point on the first linegy1 - y-coordinate of the first point on the first linegx2 - x-coordinate of the second point on the first linegy2 - y-coordinate of the second point on the first linehx1 - x-coordinate of the first point on the second linehy1 - y-coordinate of the first point on the second linehx2 - x-coordinate of the second point on the second linehy2 - y-coordinate of the second point on the second linepublic static Point intersectLineWithCircle(Ellipse2D circle, Line2D line)
circle - the circle to intersectline - the line to intersectpublic static Shape transformShape(Shape shape, double translateX, double translateY, double scaleX, double scaleY)
shape - the shape to transformtranslateX - the distance by which coordinates are translated in the X axis
directiontranslateY - the distance by which coordinates are translated in the Y axis
directionscaleX - the factor by which coordinates are scaled along the X axis
directionscaleY - the factor by which coordinates are scaled along the Y axis
directionpublic static Shape transformShape(Shape shape, double translateX, double translateY, double scale)
shape - the shape to transformtranslateX - the distance by which coordinates are translated in the X axis
directiontranslateY - the distance by which coordinates are translated in the Y axis
directionscale - the factor by which coordinates are scaled along the X/Y axis
directionpublic static Point[] intersectBezierAndLine(CubicCurve2D curve, Line2D line)
CubicCurve2D#Double.