public class Geometry
extends java.lang.Object
Constructor and Description |
---|
Geometry() |
Modifier and Type | Method and Description |
---|---|
static java.awt.geom.Point2D.Double |
bezier(double t,
java.awt.geom.CubicCurve2D curve) |
static Point |
bezier(double t,
double x1,
double y1,
double x2,
double y2,
double b1x,
double b1y,
double b2x,
double b2y) |
static Point |
bezier(double t,
Point start,
Point end,
Point b1,
Point b2)
Gives the Beziér point at parameter t for the given definition
and control points.
|
static java.awt.geom.Point2D.Double |
convert(Point point) |
static Point |
convert(java.awt.geom.Point2D point) |
static java.awt.geom.Point2D.Double |
findIntersection(java.awt.Shape shape,
java.awt.geom.CubicCurve2D curve)
Be careful, when using this method!!! It has been implemented to
specifically find one intersection point based on the assumption that the
shape contains either the beginning or the end of the curve.
|
static void |
main(java.lang.String[] args) |
public static Point bezier(double t, Point start, Point end, Point b1, Point b2)
t
- must be between zero and one.start
- must not be null
end
- must not be null
b1
- can be null
b2
- can be null
public static Point bezier(double t, double x1, double y1, double x2, double y2, double b1x, double b1y, double b2x, double b2y)
t
- x1
- y1
- x2
- y2
- b1x
- b1y
- b2x
- b2y
- public static void main(java.lang.String[] args)
public static java.awt.geom.Point2D.Double bezier(double t, java.awt.geom.CubicCurve2D curve)
t
- curve
- public static Point convert(java.awt.geom.Point2D point)
point
- public static java.awt.geom.Point2D.Double convert(Point point)
point
- public static java.awt.geom.Point2D.Double findIntersection(java.awt.Shape shape, java.awt.geom.CubicCurve2D curve)
null
will be returned!shape
- curve
- null
if no intersection exists.