public abstract class GeoArea extends Object
Constructor and Description |
---|
GeoArea() |
Modifier and Type | Method and Description |
---|---|
abstract List<double[]> |
boundingBox() |
abstract double |
boundingCircleRadius() |
abstract double[] |
closestPoint(double[] point) |
abstract boolean |
contains(double[] point) |
abstract AreaElementType |
convertToAreaElementType()
Converts the GeoRectangle to an AVCL area object
|
static double |
distance(double[] point1,
double[] point2) |
static double |
distance(double[] pt,
double[] end1,
double[] end2) |
static double |
dotProduct(double x1,
double y1,
double x2,
double y2)
Computes the dot product of 2 points
|
abstract double |
getArea() |
abstract double[] |
getCentroid() |
abstract double[] |
getIntersection(double[] point1,
double[] point2)
Determines the closest point of intersection between the region and a line
|
static double[] |
getLineIntersection(double[] line11,
double[] line12,
double[] line21,
double[] line22)
Returns the point of intersection of two lines (each defined by 2 points)
|
static double[] |
getLineSegmentIntersection(double[] end11,
double[] end12,
double[] end21,
double[] end22)
Returns the point of intersection of two line segments (defined by their end points)
|
static double[] |
getLineToSegmentIntersection(double[] line1,
double[] line2,
double[] seg1,
double[] seg2)
Returns the point of intersection of a line and a line segment
|
abstract double[] |
getSegmentIntersection(double[] point1,
double[] point2)
Determines the closest point of intersection between the region and a line segment
If the line is tangent to the polygon, null will be returned (no intersection)
|
abstract List<double[]> |
getTangents(double[] start)
Determines the points on the area's edge that are
tangentially reachable from a specified point
|
static boolean |
isColocated(double[] pt1,
double[] pt2,
double tolerance)
Returns true if two points are colocated within a specified tolerance
|
static boolean |
isColocated(double point1X,
double point1Y,
double point2X,
double point2Y,
double tolerance)
Returns true if two points are colocated within a specified tolerance
|
boolean |
isConcave() |
static boolean |
isInLineSegment(double[] point,
double[] end1,
double[] end2)
Determines whether or not a point is in a line segment, but not an end point
A point is considered to be on an end point if it is within 1mm of a segment end
All points are double[2] format
|
static boolean |
isInSegment(double pointX,
double pointY,
double end1X,
double end1Y,
double end2X,
double end2Y)
Determines whether or not a point is on a specified line segment but not an end point
A point is considered to be on an end point if it is within 1mm of a segment end
Method assumes that the point is on the line containing the segment
All points are double[2] format
|
abstract boolean |
isOnEdge(double[] point) |
static boolean |
isOnSegment(double[] point,
double[] end1,
double[] end2)
Determines whether or not a point is on a specified line segment
All points are double[2] format
|
static boolean |
isOnSegment(double pointX,
double pointY,
double end1X,
double end1Y,
double end2X,
double end2Y)
Determines whether or not a point is on a specified line segment
Method assumes that the point is on the line containing the segment
All points are double[2] format
|
List<double[]> |
orientedBoundingBox()
Will default to the orthogonal bounding box, so must be over-ridden for
GeoArea types that are not necessarily orthogonally oriented (polygon)
|
abstract String |
toMATLABString(String colorCode)
Generates a string representation of the Path object that can be used to plot the path in MATLAB
|
public abstract List<double[]> getTangents(double[] start)
start
- the point from which tangents are to be determined start[0] = x, start[1] = ypublic abstract double[] getIntersection(double[] point1, double[] point2)
point1
- first point on the line (point1[0] = x, point1[1] = y)point2
- second point on the line (point2[0] = x, point2[1] = y)public abstract double[] getSegmentIntersection(double[] point1, double[] point2)
point1
- first point on the line (point1[0] = x, point1[1] = y)point2
- second point on the line (point2[0] = x, point2[1] = y)public abstract double[] getCentroid()
public abstract double getArea()
public abstract double[] closestPoint(double[] point)
point
- double[2] with the (x, y) coordinates of the point being testedpublic abstract List<double[]> boundingBox()
public abstract double boundingCircleRadius()
public abstract boolean contains(double[] point)
point
- double[2] defining the point being testedpublic abstract boolean isOnEdge(double[] point)
point
- double[2] defining the point being testedpublic abstract AreaElementType convertToAreaElementType()
public abstract String toMATLABString(String colorCode)
colorCode
- MATLAB code for the color that is to be used in plotting the areaspublic List<double[]> orientedBoundingBox()
public boolean isConcave()
public static double distance(double[] point1, double[] point2)
point1
- point2
- public static double distance(double[] pt, double[] end1, double[] end2)
pt
- double[2] containing the (x, y) position of the point being testedend1
- double[2] containing the first endpoint of the line segmentend2
- double[2] containing the second endpoint of the line segmentpublic static double[] getLineIntersection(double[] line11, double[] line12, double[] line21, double[] line22)
line11
- the first point defining the first lineline12
- the second point defining the first lineline21
- the first point defining the second lineline22
- the second point defining the second linepublic static double[] getLineSegmentIntersection(double[] end11, double[] end12, double[] end21, double[] end22)
end12
- the first endpoint of the first line segmentend11
- the second endpoint of the first line segmentend21
- the first endpoint of the second line segmentend22
- the second endpoint of the second line segmentpublic static double[] getLineToSegmentIntersection(double[] line1, double[] line2, double[] seg1, double[] seg2)
line1
- the first point defining the lineline2
- the second point defining the lineseg1
- the first endpoint of the line segmentseg2
- the second endpoint of the line segmentpublic static boolean isOnSegment(double[] point, double[] end1, double[] end2)
point
- point being testedend1
- first endpoint of the segmentend2
- second endpoint of the segmentpublic static boolean isOnSegment(double pointX, double pointY, double end1X, double end1Y, double end2X, double end2Y)
pointX
- x coordinate of the point being testedpointY
- y coordinate of the point being testedend1X
- x coordinate of the first endpoint of the segmentend1Y
- y coordinate of the first endpoint of the segmentend2X
- x coordinate of the second endpoint of the segmentend2Y
- y coordinate of the second endpoint of the segmentpublic static boolean isInLineSegment(double[] point, double[] end1, double[] end2)
point
- point being testedend1
- first endpoint of the segmentend2
- second endpoint of the segmentpublic static boolean isInSegment(double pointX, double pointY, double end1X, double end1Y, double end2X, double end2Y)
pointX
- x coordinate of the point being testedpointY
- y coordinate of the point being testedend1X
- x coordinate of the first endpoint of the segmentend1Y
- y coordinate of the first endpoint of the segmentend2X
- x coordinate of the second endpoint of the segmentend2Y
- y coordinate of the second endpoint of the segmentpublic static boolean isColocated(double[] pt1, double[] pt2, double tolerance)
pt1
- pt2
- tolerance
- public static boolean isColocated(double point1X, double point1Y, double point2X, double point2Y, double tolerance)
point1X
- x coordinatepoint1Y
- y coordinatepoint2X
- x coordinatepoint2Y
- y coordinatetolerance
- public 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 point