public abstract class Geometry extends Object
Constructor and Description |
---|
Geometry() |
Modifier and Type | Method and Description |
---|---|
static double |
determinant(double x1,
double y1,
double x2,
double y2)
Computes the dot product of 2 points
|
static double |
dotProduct(double x1,
double y1,
double x2,
double y2)
Computes the dot product of 2 points
|
static double[] |
getClosestPointOnLine(double px,
double py,
double x1,
double y1,
double x2,
double y2)
Computes the closest point on a line (defined with 2 points) from a point
|
static double[] |
getClosestPointOnSegment(double px,
double py,
double x1,
double y1,
double x2,
double y2)
Computes the closest point on a line segment (defined with end points) from a point
|
double |
getDirectionTo(Circle circle)
Computes the direction (radians) from this object to a specified point
|
double |
getDirectionTo(double[] point)
Computes the direction (radians) from this object to a specified point
|
double |
getDirectionTo(double[] center,
double radius)
Computes the direction (radians) from this object to a specified point
|
double |
getDirectionTo(double[] end1,
double[] end2)
Computes the direction (radians) from this Geometry object to the closest point on a line segment
|
abstract double |
getDirectionTo(double x2,
double y2)
Computes the direction (radians) from the Geometry object to a specified point
|
abstract double |
getDirectionTo(double centerX,
double centerY,
double radius)
Computes the direction (radians) from the Geometry object to a Circle
|
abstract double |
getDirectionTo(double x1,
double y1,
double x2,
double y2)
Computes the direction (radians) from this point to the closest point on a line segment
|
double |
getDirectionTo(Point point)
Computes the direction (radians) from this object to a specified point
|
double |
getDirectionTo(Point center,
double radius)
Computes the direction (radians) from this object to a specified point
|
double |
getDirectionTo(Point end1,
Point end2)
Computes the direction (radians) from this Geometry object to the closest point on a line segment
|
double |
getDistance(Circle circle)
Computes the distance from the Geometry object to a Circle
|
double |
getDistance(double[] point)
Computes the distance from the Geometry object to a Point
|
double |
getDistance(double[] center,
double radius)
Computes the distance from the Geometry object to a Circle
|
double |
getDistance(double[] end1,
double[] end2)
Computes the distance between this object and a line segment
|
abstract double |
getDistance(double x,
double y)
Computes the distance from the Geometry object to a Point
|
abstract double |
getDistance(double centerX,
double centerY,
double radius)
Computes the distance from the Geometry object to a Circle
|
abstract double |
getDistance(double x1,
double y1,
double x2,
double y2)
Computes the distance between this Geometry object and a line segment
|
double |
getDistance(LineSegment segment)
Computes the distance between this object and a line segment
|
double |
getDistance(Point point)
Computes the distance from the Geometry object to a Point
|
double |
getDistance(Point center,
double radius)
Computes the distance from the Geometry object to a Circle
|
double |
getDistance(Point end1,
Point end2)
Computes the distance between this object and a line segment
|
static double[] |
getIntersectPoint(double line1x1,
double line1y1,
double line1x2,
double line1y2,
double line2x1,
double line2y1,
double line2x2,
double line2y2)
Computes the point of intersection between 2 lines (defined by 2 points each)
|
static boolean |
isInSegment(double px,
double py,
double x1,
double y1,
double x2,
double y2)
Determines whether a point lies on a line segment (defined with end points) from a point
but is not actually an end point (at least 1mm from the end)
|
static boolean |
isOnSegment(double px,
double py,
double x1,
double y1,
double x2,
double y2)
Determines whether a point lies on a line segment (defined with end points) from a point
|
static double |
pointDirection(double x1,
double y1,
double x2,
double y2)
Computes the direction from one point to another (radians)
|
static double |
pointDistance(double x1,
double y1,
double x2,
double y2)
Computes the distance (meters) between 2 points
|
public abstract double getDistance(double x, double y)
x
- north/south coordinate of the point being testedy
- east/west coordinate of the point being testedpublic abstract double getDirectionTo(double x2, double y2)
x2
- x coordinate of the point being testedy2
- y coordinate of the point being testedpublic abstract double getDistance(double centerX, double centerY, double radius)
centerX
- north/south coordinate of the circle being testedcenterY
- east/west coordinate of the circle being testedradius
- of the circle being testedpublic abstract double getDirectionTo(double centerX, double centerY, double radius)
centerX
- x coordinate of the point being testedcenterY
- y coordinate of the point being testedradius
- of the circle being testedpublic abstract double getDistance(double x1, double y1, double x2, double y2)
x1
- north/south coordinate of the first segment end pointy1
- east west coordinate of the first segment end pointx2
- north/south coordinate of the second segment end pointy2
- east west coordinate of the second segment end pointpublic abstract double getDirectionTo(double x1, double y1, double x2, double y2)
x1
- north/south coordinate of the first segment end pointy1
- east west coordinate of the first segment end pointx2
- north/south coordinate of the second segment end pointy2
- east west coordinate of the second segment end pointpublic double getDistance(Point point)
point
- the point being testedpublic double getDistance(double[] point)
point
- public double getDirectionTo(Point point)
point
- the point being testedpublic double getDirectionTo(double[] point)
point
- the point being testedpublic double getDistance(Circle circle)
circle
- the circle being testedpublic double getDistance(Point center, double radius)
center
- the center point of the circle being testedradius
- of the circle being testedpublic double getDistance(double[] center, double radius)
center
- the center point of the circle being testedradius
- of the circle being testedpublic double getDirectionTo(Circle circle)
circle
- the circle being testedpublic double getDirectionTo(Point center, double radius)
center
- the center point of the circle being testedradius
- of the circle being testedpublic double getDirectionTo(double[] center, double radius)
center
- the center point of the circle being testedradius
- of the circle being testedpublic double getDistance(LineSegment segment)
segment
- the line segment being testedpublic double getDistance(Point end1, Point end2)
end1
- the first endpoint of the segment being testedend2
- the second endpoint of the segment being testedpublic double getDistance(double[] end1, double[] end2)
end1
- the first endpoint of the segment being testedend2
- the first endpoint of the segment being testedpublic double getDirectionTo(double[] end1, double[] end2)
end1
- the Cartesian coordinates of the first segment end pointend2
- the Cartesian coordinates of the second segment end pointpublic double getDirectionTo(Point end1, Point end2)
end1
- the Cartesian coordinates of the first segment end pointend2
- the Cartesian coordinates of the second segment end pointpublic static double dotProduct(double x1, double y1, double x2, double y2)
x1
- north/south Cartesian coordinate of the first pointy1
- east/west Cartesian coordinate of the first pointx2
- north/south Cartesian coordinate of the second pointy2
- east/west Cartesian coordinate of the second pointpublic static double determinant(double x1, double y1, double x2, double y2)
x1
- north/south Cartesian coordinate of the first pointy1
- east/west Cartesian coordinate of the first pointx2
- north/south Cartesian coordinate of the second pointy2
- east/west Cartesian coordinate of the second pointpublic static double[] getIntersectPoint(double line1x1, double line1y1, double line1x2, double line1y2, double line2x1, double line2y1, double line2x2, double line2y2)
line1x1
- north/south coordinate of the first segment end pointline1y1
- east west coordinate of the first segment end pointline1x2
- north/south coordinate of the second segment end pointline1y2
- east west coordinate of the second segment end pointline2x1
- north/south coordinate of the first segment end pointline2y1
- east west coordinate of the first segment end pointline2x2
- north/south coordinate of the second segment end pointline2y2
- east west coordinate of the second segment end pointpublic static double[] getClosestPointOnLine(double px, double py, double x1, double y1, double x2, double y2)
px
- north/south coordinate of the point being testedpy
- east west coordinate of the point being testedx1
- north/south coordinate of the first line pointy1
- east west coordinate of the first line pointx2
- north/south coordinate of the second segment end pointy2
- east west coordinate of the second segment end pointpublic static double[] getClosestPointOnSegment(double px, double py, double x1, double y1, double x2, double y2)
px
- north/south coordinate of the point being testedpy
- east west coordinate of the point being testedx1
- north/south coordinate of the first segment end pointy1
- east west coordinate of the first segment end pointx2
- north/south coordinate of the second segment end pointy2
- east west coordinate of the second segment end pointpublic static boolean isOnSegment(double px, double py, double x1, double y1, double x2, double y2)
px
- north/south coordinate of the point being testedpy
- east west coordinate of the point being testedx1
- north/south coordinate of the first segment end pointy1
- east west coordinate of the first segment end pointx2
- north/south coordinate of the second segment end pointy2
- east west coordinate of the second segment end pointpublic static boolean isInSegment(double px, double py, double x1, double y1, double x2, double y2)
px
- north/south coordinate of the point being testedpy
- east west coordinate of the point being testedx1
- north/south coordinate of the first segment end pointy1
- east west coordinate of the first segment end pointx2
- north/south coordinate of the second segment end pointy2
- east west coordinate of the second segment end pointpublic static double pointDistance(double x1, double y1, double x2, double y2)
x1
- north/south coordinate of the first pointy1
- east/west coordinate of the first pointx2
- north/south coordinate of the second pointy2
- east/west coordinate of the second pointpublic static double pointDirection(double x1, double y1, double x2, double y2)
x1
- north/south coordinate of the first pointy1
- east/west coordinate of the first pointx2
- north/south coordinate of the second pointy2
- east/west coordinate of the second point