public class TLcdEllipsoidRhumblineUtil extends Object
Modifier and Type | Method and Description |
---|---|
static double |
closestPointOnRhumbline(ILcdPoint aP1,
ILcdPoint aP2,
ILcdPoint aP3,
ILcdEllipsoid aEllipsoid,
double aRelativeTolerance,
double aAbsoluteTolerance,
ILcd2DEditablePoint aResultSFCT)
Finds the shortest rhumb distance from point
aP3 to the rhumbline
segment aP1-aP2 within an accuracy of
max( aAbsoluteTolerance, aRelativeTolerance * rhumblineDistance(aP1,aP2) ) . |
static double |
closestPointOnRhumblineGeodesic(ILcdPoint aP1,
ILcdPoint aP2,
ILcdPoint aP3,
ILcdEllipsoid aEllipsoid,
double aRelativeTolerance,
double aAbsoluteTolerance,
ILcd2DEditablePoint aResultSFCT)
Finds the shortest geodesic distance from point
aP3 to the rhumbline
segment aP1-aP2 within an accuracy of
max( aAbsoluteTolerance, aRelativeTolerance * rhumblineDistance(aP1,aP2) ) . |
static double |
closestPointOnShape(ILcdPoint aPoint,
ILcdShape aShape,
ILcdEllipsoid aEllipsoid,
ILcd2DEditablePoint aResultSFCT)
Finds the shortest rhumb distance from the given point to the given shape.
|
static boolean |
contains2D(ILcdEllipsoid aEllipsoid,
ILcdPoint aP1,
ILcdPoint aP2,
ILcdPoint aPoint)
Checks if the point
aPoint lies on the rhumb line between
aP1 and aP2 . |
static boolean |
contains2DLS(ILcdEllipsoid aEllipsoid,
ILcdPoint aP1,
ILcdPoint aP2,
ILcdPoint aP3,
ILcdPoint aP4)
Checks if the rhumb line between aP1 and aP2 contains the rhumb line between aP3 and aP4.
|
static int |
intersection2DLineSegments(ILcdPoint aP1,
ILcdPoint aP2,
ILcdPoint aP3,
ILcdPoint aP4,
ILcdEllipsoid aEllipsoid,
ILcd2DEditablePoint aResult1SFCT,
ILcd2DEditablePoint aResult2SFCT)
Computes the intersection of two rhumb lines.
|
static int |
intersectionGeodesicRhumblineSFCT(ILcdPoint aP1,
ILcdPoint aP2,
ILcdPoint aP3,
ILcdPoint aP4,
ILcdEllipsoid aEllipsoid,
ILcd2DEditablePoint[] aPointsSFCT)
Computes the intersection points of a geodesic and a rhumb line.
|
static boolean |
intersects2DLS(ILcdEllipsoid aEllipsoid,
ILcdPoint aP1,
ILcdPoint aP2,
ILcdPoint aP3,
ILcdPoint aP4)
Checks if two rhumb lines intersect.
|
static boolean |
intersectsGeodesicRhumbline(ILcdEllipsoid aEllipsoid,
ILcdPoint aP1,
ILcdPoint aP2,
ILcdPoint aP3,
ILcdPoint aP4)
Checks if a geodesic and a rhumb line intersect.
|
static boolean |
polygonContains2D(ILcdEllipsoid aEllipsoid,
ILcdPolygon aPolygon,
double aLonP,
double aLatP)
Checks if a point lies inside a polygon.
|
static double |
rhumblineDistance3D(ILcdPoint aPoint1,
ILcdPoint aPoint2,
ILcdEllipsoid aEllipsoid)
Calculates the rhumbline distance to go from point p1 to point p2.
|
static void |
rhumblinePointSFCT(ILcdEllipsoid aEllipsoid,
ILcdPoint aP1,
ILcdPoint aP2,
double aK,
ILcd2DEditablePoint aRhumblinePoint)
Calculates the rhumbline point at a fraction
aK of the rhumbline
distance between two points aP1 and aP2 . |
public static boolean contains2D(ILcdEllipsoid aEllipsoid, ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aPoint)
aPoint
lies on the rhumb line between
aP1
and aP2
.aEllipsoid
- ellipsoid on which the rhumb line is defined.aP1
- start point of the rhumb line.aP2
- end point of the rhumb line.aPoint
- point to be checked.public static boolean contains2DLS(ILcdEllipsoid aEllipsoid, ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdPoint aP4)
aEllipsoid
- ellipsoid on which the rhumb lines are defined.aP1
- start point of the first rhumb line.aP2
- end point of the first rhumb line.aP3
- start point of the second rhumb line.aP4
- end point of the second rhumb line.public static boolean polygonContains2D(ILcdEllipsoid aEllipsoid, ILcdPolygon aPolygon, double aLonP, double aLatP)
aLonP
,aLatP
to be inside if:
aEllipsoid
- ellipsoid on which the polygon and point are defined.aPolygon
- polygon w.r.t. which the test is performed.aLonP
- longitude of the point to be tested in degrees.aLatP
- latitude of the point to be tested in degrees.public static boolean intersects2DLS(ILcdEllipsoid aEllipsoid, ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdPoint aP4)
aEllipsoid
- ellipsoid on which the rhumb lines are defined.aP1
- start point of the first rhumb line.aP2
- end point of the first rhumb line.aP3
- start point of the second rhumb line.aP4
- end point of the second rhumb line.public static int intersection2DLineSegments(ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdPoint aP4, ILcdEllipsoid aEllipsoid, ILcd2DEditablePoint aResult1SFCT, ILcd2DEditablePoint aResult2SFCT)
The method has two ILcd2DEditablePoint
objects
as side effect parameters containing the result. They are filled
in depending on the return value of the method.
aP1
- the start point of the first rhumb line.aP2
- the end point of the first rhumb line.aP3
- the start point of the second rhumb line.aP4
- the end point of the second rhumb line.aEllipsoid
- the ellipsoid on which the points are defined.aResult1SFCT
- the intersection point (or an end point of the interval of overlapping points).aResult2SFCT
- if there is an interval of overlapping points, this contains one of the end points.public static boolean intersectsGeodesicRhumbline(ILcdEllipsoid aEllipsoid, ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdPoint aP4)
aEllipsoid
- ellipsoid on which the geodesic and rhumb line are defined.aP1
- start point of the geodesic.aP2
- end point of the geodesic.aP3
- start point of the rhumb line.aP4
- end point of the rhumb line.public static int intersectionGeodesicRhumblineSFCT(ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdPoint aP4, ILcdEllipsoid aEllipsoid, ILcd2DEditablePoint[] aPointsSFCT)
aP1
- the start point of the geodesic.aP2
- the end point of the geodesic.aP3
- the start point of the rhumb line.aP4
- the end point of the rhumb line.aEllipsoid
- the ellipsoid on which the points are defined.aPointsSFCT
- The array of points in which the results should be stored.0
is returned.
If the geodesic and rhumb line share an interval of points, -1
is returned.
In this case, aPointsSFCT contains the two end points of this interval.IndexOutOfBoundsException
- If the length of aPointsSFCT
is smaller than the number
of intersection points.public static void rhumblinePointSFCT(ILcdEllipsoid aEllipsoid, ILcdPoint aP1, ILcdPoint aP2, double aK, ILcd2DEditablePoint aRhumblinePoint)
aK
of the rhumbline
distance between two points aP1
and aP2
.aEllipsoid
- the ellipsoid on which to perform the calculationsaP1
- the first point of the rhumb lineaP2
- the second point of the rhumb lineaK
- the fraction of the rhumbline distance between aP1
and aP2
aRhumblinePoint
- the resulting pointpublic static double closestPointOnShape(ILcdPoint aPoint, ILcdShape aShape, ILcdEllipsoid aEllipsoid, ILcd2DEditablePoint aResultSFCT)
This methods supports rhumb
ILcdPolyline
and ILcdPolygon
instances.
For the shortest geodesic distance to a rhumb shape, see TLcdEllipsoidUtil.closestPointOnShape(com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdShape, com.luciad.geodesy.ILcdEllipsoid, com.luciad.shape.shape2D.ILcd2DEditablePoint)
aPoint
- the starting pointaShape
- the shape for which to find the point closest to aPointaEllipsoid
- the ellipsoid on which to perform the calculationaResultSFCT
- side-effect parameter for the resulting pointIllegalArgumentException
- if the provided shape is not supportedpublic static double closestPointOnRhumbline(ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdEllipsoid aEllipsoid, double aRelativeTolerance, double aAbsoluteTolerance, ILcd2DEditablePoint aResultSFCT)
Finds the shortest rhumb distance from point aP3
to the rhumbline
segment aP1-aP2
within an accuracy of
max( aAbsoluteTolerance, aRelativeTolerance * rhumblineDistance(aP1,aP2) )
.
The corresponding point on the rhumbline segment is returned in the
side effect parameter aResultSFCT
.
The difference between this method and the closestPointOnRhumblineGeodesic
method is that the rhumb distance is used instead of the geodesic distance.
aP1
- start point of the rhumbline segment.aP2
- end point of the rhumbline segment.aP3
- point from which the shortest distance to the line segment is sought.aEllipsoid
- ellipsoid on which to perform the calculation.aRelativeTolerance
- relative tolerance.aAbsoluteTolerance
- absolute tolerance.aResultSFCT
- contains the point on the rhumbline segment that
is the shortest from point aP3
.aP3
to the rhumbline segment aP1-aP2
(meters).public static double closestPointOnRhumblineGeodesic(ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdEllipsoid aEllipsoid, double aRelativeTolerance, double aAbsoluteTolerance, ILcd2DEditablePoint aResultSFCT)
Finds the shortest geodesic distance from point aP3
to the rhumbline
segment aP1-aP2
within an accuracy of
max( aAbsoluteTolerance, aRelativeTolerance * rhumblineDistance(aP1,aP2) )
.
The corresponding point on the rhumbline segment is returned in the
side effect parameter aResultSFCT
.
The difference between this method and the closestPointOnRhumbline
method is that the geodesic distance is used instead of the rhumb distance.
aP1
- start point of the rhumbline segment.aP2
- end point of the rhumbline segment.aP3
- point from which the shortest distance to the line segment is sought.aEllipsoid
- ellipsoid on which to perform the calculation.aRelativeTolerance
- relative tolerance.aAbsoluteTolerance
- absolute tolerance.aResultSFCT
- contains the point on the rhumbline segment that
is the shortest from point aP3
.aP3
to the rhumbline segment aP1-aP2
(meters).public static double rhumblineDistance3D(ILcdPoint aPoint1, ILcdPoint aPoint2, ILcdEllipsoid aEllipsoid)
ILcdEllipsoid#rhumblineDistance
, which ignores the height of the points, the distance calculations of this
method take the heights of the given points into account.aPoint1
- the start (geodetic) pointaPoint2
- the end (geodetic) pointaEllipsoid
- the ellipsoid on which to perform the distance calculation