Class TLcdEllipsoid
- All Implemented Interfaces:
ILcdEllipsoid
,Serializable
TLcdEllipsoid
represents an ellipsoid and is the implementation
of an ILcdEllipsoid
.
Typically it is defined by:
- a semiMajorRadius (usually represented by the letter a), and
- a semiMinorRadius (usually represented by the letter b).
- initializeAB
- initializeA1OverF
Many methods of the TLcdEllipsoid
refer to specialist's
knowledge and will not be explained here.
Also the calculations involved are usually not trivial.
We refer for more information to following references:
- Map Projections: Theory and Applications, 1990, Pearson
- Coordinate Systems and Map Projections, 2nd edition, 1992, Maling
- Map Projections: A Working Manual, 1987, Snyder
- Map Projections: A Reference Manual, 1995, Bugayevski and Snyder
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TLcdEllipsoid
Default ellipsoid object representing the WGS1984 ellipsoid. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bufferContour2DOf2DPolylineSFCT
(ILcdPointList aPointList, double aWidth, ILcd2DEditablePoint[] a2DEditablePointArraySFCT) Calculates the contour of the buffer/corridor along a givenILcdPointList
at a given width.void
bufferContour2DOfSegmentSFCT
(ILcdPoint aStartPoint, ILcdPoint aEndPoint, double aWidth, ILcd2DEditablePoint[] a2DEditablePointArraySFCT) Calculates the contour of the rectangle defined byaStartPoint
,aEndPoint
, andaWidth
, as an array of 4ILcd2DEditablePoint
objects.void
conformalSphericalLonLatPointSFCT
(ILcdPoint aLLP, ILcd2DEditablePoint aLLPSFCT) The conformal spherical longitude/latitude for a given geodetic longitude/latitude.static double
distanceToGeodesic
(double aLon1, double aLat1, double aLon2, double aLat2, double aLon3, double aLat3, double aAngle) Calculates the distance between the geodesic(aLon1,aLat1)-(aLon2,aLat2)
and point(aLon3,aLat3)
, at a certain angleaAngle
.double
distanceToGeodesic
(ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, double aAngle) Calculates the distance between the geodesicaP1-aP2
and the pointaP3
, at a certain angleaAngle
.boolean
Overrides Object.equals.double
forwardAzimuth2D
(double aLon1, double aLat1, double aLon2, double aLat2) Calculates the forward azimuth of the geodesic line fromaP1
toaP2
in radians ! Only the (x,y) coordinates (longitude and latitude) of theILcdPoint
objects are taken into account.double
forwardAzimuth2D
(ILcdPoint aP1, ILcdPoint aP2) Calculates the forward azimuth of the geodesic line fromaP1
toaP2
in radians ! Only the (x,y) coordinates (longitude and latitude) of theILcdPoint
objects are taken into account.double
geoc2height
(ILcdPoint aXYZGeocPoint) Calculates the height above the ellipsoid for a point defined in an Earth Centered, Earth Fixed XYZ Cartesian coordinate system.void
geoc2llhSFCT
(ILcdPoint aXYZPoint, ILcd3DEditablePoint aLLHPointSFCT) Coordinate conversion between Earth Centered, Earth Fixed XYZ Cartesian coordinate system and latitude-longitude-ellipsoidal height for the ellipsoid.double
geodesicArea
(ILcdPoint[] aPts, int aN) Calculates the geodesic surface area of a polygon given as an array ofILcdPoint
objects.double
geodesicDistance
(double aLon1, double aLat1, double aLon2, double aLat2) Calculates the shortest distance between two arbitraryILcdPoint
objectsaP1
andaP2
on the ellipsoid in meters.double
geodesicDistance
(ILcdPoint aP1, ILcdPoint aP2) Calculates the shortest distance between two arbitraryILcdPoint
objectsaP1
andaP2
on the ellipsoid in meters.void
geodesicPointSFCT
(ILcdPoint aPoint, double aDistance, double aAzimuth, ILcd2DEditablePoint aGeodesicPointSFCT) Determines theILcdPoint
aGeodesicPoint
on the geodesic through(aP1.getX(), aP1.getY())
located at a distanceaDistance
and forward azimuthaAzimuth
.void
geodesicPointSFCT
(ILcdPoint aP1, ILcdPoint aP2, double aK, ILcd2DEditablePoint aGeodesicPointSFCT) SetsaGeodesicPointSFCT
to anILcdPoint
on the geodesic line through the pointaP1
and the pointaP2
, located at a fractionaK
of the (shortest) distance betweenaP1
andaP2
.double
Gets the reciprocal of the flattening 1/f.double
getA()
Gets the semiMajorRadius a.double
Radius of auxiliary sphere of the ellipsoid.double
getB()
Gets the semiMinorRadius b.double
Radius of a sphere such that its meridional arc from 0 -> 90 degrees is equal to the corresponding meridional arc on the ellipsoid.double
getE()
Gets the eccentricity e which is always positive.double
getE2()
Gets the eccentricitySquared e2 = (a2 - b2)/a2.double
Gets the secondEccentricitySquared e' 2 = (a2 - b2 )/b2.double
getF()
Gets the flattening f.double
getN()
Gets n = (a - b)/(a + b).getName()
Gets the name of thisILcdEllipsoid
.int
hashCode()
void
initializeA1OverF
(double aA, double a1OverF) The ellipsoidal characteristics can be initialized by setting the semiMajorAxis a and the reciprocal of the flattening f.void
initializeAB
(double aA, double aB) The ellipsoidal characteristics can be initialized by setting the semiMajorAxis a and the semiMinorAxis b.void
intersection2DLSSFCT
(double aLon1, double aLat1, double aLon2, double aLat2, double aLon3, double aLat3, double aLon4, double aLat4, ILcd2DEditablePoint aLLPSFCT) Calculates the intersection of two geodesic lines going through the given coordinates.void
intersection2DLSSFCT
(ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdPoint aP4, ILcd2DEditablePoint aLLPSFCT) Calculates the intersection of two geodesic lines going containing the given coordinates.boolean
intersects2DLS
(double aLon1, double aLat1, double aLon2, double aLat2, double aLon3, double aLat3, double aLon4, double aLat4) Checks whether two geodesic line segments with the given coordinates intersect.boolean
intersects2DLS
(ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdPoint aP4) Checks whether two geodesic line segments intersect.void
inverseConformalSphericalLonLatPointSFCT
(ILcdPoint aLLP, ILcd2DEditablePoint aLLPSFCT) The inverse transformation of the conformal spherical longitude/latitude.boolean
isSphere()
Checks whether ellipsoid is the special case sphere.void
llh2geocSFCT
(ILcdPoint aLLHPoint, ILcd3DEditablePoint aXYZGeocentricPointSFCT) Coordinate conversion between latitude-longitude-ellipsoidal height for the ellipsoid and Earth Centered, Earth Fixed XYZ Cartesian coordinate system.double
meridionalArcDistance
(double aLatitude) Calculates the meridional arc distance in meters.double
meridionalArcDistance
(double aLatitude, double aCosLat, double aSinLat) Calculates the meridional arc distance in meters.double
radiusEuler
(double aLatitude, double aAzimuth) Euler radius of the ellipsoid at a given latitudeaLatitude
and a given azimuthaAzimuth
.double
radiusEuler
(double aLatitude, double aSinLat, double aAzimuth, double aCosAzimuth, double aSinAzimuth) Euler radius of the ellipsoid at a given latitudeaLatitude
and a given azimuthaAzimuth
.double
radiusGaussian
(double aLat) The Gaussian curvature radius is the geometric mean of the vertical and the meridional radius.double
radiusGaussian
(double aLat, double aSinLat) The Gaussian curvature radius is the geometric mean of the vertical and the meridional radius.double
radiusMeridian
(double aLatitude) Radius of curvature in prime meridian at a given geodetic latitude.double
radiusMeridian
(double aLatitude, double aSinLat) Radius of curvature in prime meridian at a given geodetic latitude.double
radiusVertical
(double aLatitude) Radius of curvature in prime vertical at a given geodetic latitude.double
radiusVertical
(double aLatitude, double aSinLat) Radius of curvature in prime vertical at a given geodetic latitude.double
rhumblineAzimuth2D
(ILcdPoint aP1, ILcdPoint aP2) Calculates the azimuth of the rhumbline fromaP1
toaP2
in degrees! Only the (x,y) coordinates (longitude and latitude) of theILcdPoint
objects are taken into account.double
rhumblineDistance
(ILcdPoint aP1, ILcdPoint aP2) Calculates the distance between two arbitraryILcdPoint
objectsaP1
andaP2
on the ellipsoid in meters following a path with constant azimuth.void
rhumblinePointSFCT
(ILcdPoint aPoint, double aDistance, double aAzimuth, ILcd2DEditablePoint aRhumblinePointSFCT) Determines theILcdPoint
aRhumblinePointSFCT
on the rhumbline (a path with a constant bearing) through(aP1.getX(), aP1.getY())
located at a distanceaDistance
and forward azimuthaAzimuth
.void
Sets the name of this ellipsoid.toString()
-
Field Details
-
DEFAULT
Default ellipsoid object representing the WGS1984 ellipsoid.
-
-
Constructor Details
-
TLcdEllipsoid
public TLcdEllipsoid()Default ellipsoid construction is the WGS_1984 ellipsoid.
-
-
Method Details
-
initializeAB
public void initializeAB(double aA, double aB) The ellipsoidal characteristics can be initialized by setting the semiMajorAxis a and the semiMinorAxis b.- Parameters:
aA
- radius of major axis.aB
- radius of minor axis.
-
initializeA1OverF
public void initializeA1OverF(double aA, double a1OverF) The ellipsoidal characteristics can be initialized by setting the semiMajorAxis a and the reciprocal of the flattening f.- Parameters:
aA
- radius of major axis.a1OverF
- reciprocal value of flattening.
-
getA
public double getA()Description copied from interface:ILcdEllipsoid
Gets the semiMajorRadius a.- Specified by:
getA
in interfaceILcdEllipsoid
- Returns:
- the SemiMajorRadius a.
-
getB
public double getB()Description copied from interface:ILcdEllipsoid
Gets the semiMinorRadius b.- Specified by:
getB
in interfaceILcdEllipsoid
- Returns:
- the SemiMinorRadius b.
-
get1OverF
public double get1OverF()Description copied from interface:ILcdEllipsoid
Gets the reciprocal of the flattening 1/f.- Specified by:
get1OverF
in interfaceILcdEllipsoid
- Returns:
- the reciprocal of the flattening 1/f.
-
getF
public double getF()Description copied from interface:ILcdEllipsoid
Gets the flattening f.- Specified by:
getF
in interfaceILcdEllipsoid
- Returns:
- the flattening f.
-
getE
public double getE()Description copied from interface:ILcdEllipsoid
Gets the eccentricity e which is always positive.- Specified by:
getE
in interfaceILcdEllipsoid
- Returns:
- the eccentricity e which is always positive.
-
getE2
public double getE2()Description copied from interface:ILcdEllipsoid
Gets the eccentricitySquared e2 = (a2 - b2)/a2.- Specified by:
getE2
in interfaceILcdEllipsoid
- Returns:
- the eccentricitySquared e2 = (a2 - b2 )/a2.
-
getEMinor2
public double getEMinor2()Description copied from interface:ILcdEllipsoid
Gets the secondEccentricitySquared e' 2 = (a2 - b2 )/b2.- Specified by:
getEMinor2
in interfaceILcdEllipsoid
- Returns:
- the secondEccentricitySquared e' 2 = (a2 - b2 )/b2 .
-
getN
public double getN()Description copied from interface:ILcdEllipsoid
Gets n = (a - b)/(a + b).- Specified by:
getN
in interfaceILcdEllipsoid
- Returns:
- n = (a - b)/(a + b).
-
isSphere
public boolean isSphere()Description copied from interface:ILcdEllipsoid
Checks whether ellipsoid is the special case sphere.- Specified by:
isSphere
in interfaceILcdEllipsoid
- Returns:
true
if and only if ellipsoid is a sphere.
-
radiusVertical
public double radiusVertical(double aLatitude) Description copied from interface:ILcdEllipsoid
Radius of curvature in prime vertical at a given geodetic latitude. Commonly referred to with a Greek letter n.- Specified by:
radiusVertical
in interfaceILcdEllipsoid
- Parameters:
aLatitude
- latitude, in degrees.- Returns:
- the radius of curvature in prime vertical at a given geodetic latitude.
- See Also:
-
radiusVertical
public double radiusVertical(double aLatitude, double aSinLat) Description copied from interface:ILcdEllipsoid
Radius of curvature in prime vertical at a given geodetic latitude. Commonly referred to with a Greek letter n.- Specified by:
radiusVertical
in interfaceILcdEllipsoid
- Parameters:
aLatitude
- latitude, in degrees.aSinLat
- the sine of the latitude.- Returns:
- the radius of curvature in prime vertical at a given geodetic latitude.
- See Also:
-
radiusMeridian
public double radiusMeridian(double aLatitude) Description copied from interface:ILcdEllipsoid
Radius of curvature in prime meridian at a given geodetic latitude.- Specified by:
radiusMeridian
in interfaceILcdEllipsoid
- Parameters:
aLatitude
- latitude, in degrees.- Returns:
- the radius of curvature in prime meridian at a given geodetic latitude.
- See Also:
-
radiusMeridian
public double radiusMeridian(double aLatitude, double aSinLat) Description copied from interface:ILcdEllipsoid
Radius of curvature in prime meridian at a given geodetic latitude.- Specified by:
radiusMeridian
in interfaceILcdEllipsoid
- Parameters:
aLatitude
- latitude, in degrees.aSinLat
- the sine of the latitude.- Returns:
- the radius of curvature in prime meridian at a given geodetic latitude.
-
meridionalArcDistance
public double meridionalArcDistance(double aLatitude) Calculates the meridional arc distance in meters. The length of the arc measured from the plane of the equator to a point at latitudeaLatitude
. Since the earth is represented by a rotational ellipsoid the longitude is irrelevant.A truncated series expansion is listed in Coordinate Systems and Map Projections, 2nd edition, 1992, Maling. The authors derived more terms to obtain a better accuracy.
- Specified by:
meridionalArcDistance
in interfaceILcdEllipsoid
- Parameters:
aLatitude
- latitude, in degrees.- Returns:
- the meridional arc distance in meters.
- See Also:
-
meridionalArcDistance
public double meridionalArcDistance(double aLatitude, double aCosLat, double aSinLat) Calculates the meridional arc distance in meters. The length of the arc measured from the plane of the equator to a point at latitudeaLatitude
. Since the earth is represented by a rotational ellipsoid the longitude is irrelevant.A truncated series expansion is listed in Coordinate Systems and Map Projections, 2nd edition, 1992, Maling. The authors derived more terms to obtain a better accuracy.
- Specified by:
meridionalArcDistance
in interfaceILcdEllipsoid
- Parameters:
aLatitude
- latitude, in degrees.aCosLat
- the cosine of the latitude.aSinLat
- the sine of the latitude.- Returns:
- the meridional arc distance in meters.
-
conformalSphericalLonLatPointSFCT
Description copied from interface:ILcdEllipsoid
The conformal spherical longitude/latitude for a given geodetic longitude/latitude. These lon-lat-points are represented byILcdPoint
objects. A conformal projection is a projection for which the shape of a figure on the earth is preserved on the map. For a thorough understanding the reader is referred to the references.- Specified by:
conformalSphericalLonLatPointSFCT
in interfaceILcdEllipsoid
- Parameters:
aLLP
- Geodetic point on the ellipsoid.aLLPSFCT
- Geodetic point on the conformal sphere.
-
inverseConformalSphericalLonLatPointSFCT
Description copied from interface:ILcdEllipsoid
The inverse transformation of the conformal spherical longitude/latitude.- Specified by:
inverseConformalSphericalLonLatPointSFCT
in interfaceILcdEllipsoid
- Parameters:
aLLP
- Geodetic point on the conformal sphere.aLLPSFCT
- Geodetic point on the ellipsoid.- See Also:
-
geoc2llhSFCT
Coordinate conversion between Earth Centered, Earth Fixed XYZ Cartesian coordinate system and latitude-longitude-ellipsoidal height for the ellipsoid.The direct solution implemented here is taken from Peter Dana's page on "Geodetic datum overview": https://foote.geography.uconn.edu/gcraft/notes/datum/datum.html. This solution is an approximation by only including terms up to e2.
- Specified by:
geoc2llhSFCT
in interfaceILcdEllipsoid
- Parameters:
aXYZPoint
- geocentric 3D point.aLLHPointSFCT
- lonLatHeight coordinates to be set.
-
geoc2height
Description copied from interface:ILcdEllipsoid
Calculates the height above the ellipsoid for a point defined in an Earth Centered, Earth Fixed XYZ Cartesian coordinate system.- Specified by:
geoc2height
in interfaceILcdEllipsoid
- Parameters:
aXYZGeocPoint
- geocentric 3D point- Returns:
- the height above the ellipsoid
-
llh2geocSFCT
Coordinate conversion between latitude-longitude-ellipsoidal height for the ellipsoid and Earth Centered, Earth Fixed XYZ Cartesian coordinate system.The solution implemented here is taken from Peter Dana's page on "Geodetic datum overview": https://foote.geography.uconn.edu/gcraft/notes/datum/datum.html.
- Specified by:
llh2geocSFCT
in interfaceILcdEllipsoid
- Parameters:
aLLHPoint
- lonLatHeight point.aXYZGeocentricPointSFCT
- Geocentric coordinates to be set.
-
getAuxRadius
public double getAuxRadius()Radius of auxiliary sphere of the ellipsoid. The simplest choice is to take the semiMajorAxis of the ellipsoid.Simplest choice of radius of auxiliary sphere returns the major semi-axis.
- Specified by:
getAuxRadius
in interfaceILcdEllipsoid
- Returns:
- the major semi-axis a.
-
getConformalRadius
public double getConformalRadius()Description copied from interface:ILcdEllipsoid
Radius of a sphere such that its meridional arc from 0 -> 90 degrees is equal to the corresponding meridional arc on the ellipsoid.- Specified by:
getConformalRadius
in interfaceILcdEllipsoid
- Returns:
- the radius of a sphere such that its meridional arc from 0 -> 90 degrees is equal to the corresponding meridional arc on the ellipsoid.
-
geodesicDistance
public double geodesicDistance(double aLon1, double aLat1, double aLon2, double aLat2) Description copied from interface:ILcdEllipsoid
Calculates the shortest distance between two arbitraryILcdPoint
objectsaP1
andaP2
on the ellipsoid in meters.- Specified by:
geodesicDistance
in interfaceILcdEllipsoid
- Parameters:
aLon1
- longitude, in degrees, of the start point of the geodesic line segment.aLat1
- latitude, in degrees, of the start point of the geodesic line segment.aLon2
- longitude, in degrees, of the end point of the geodesic line segment.aLat2
- latitude, in degrees, of the end point of the geodesic line segment.- Returns:
- the same as
geodesicDistance(ILcdPoint aP1, ILcdPoint aP2)
ifaP1
would be anILcdPoint
with lon-lat coordinates(aLongitude1,aLatitude1)
andaP2
would be aILcdPoint
with lon-lat coordinates(aLongitude2,aLatitude2)
. - See Also:
-
geodesicDistance
Description copied from interface:ILcdEllipsoid
Calculates the shortest distance between two arbitraryILcdPoint
objectsaP1
andaP2
on the ellipsoid in meters. The curve that represents this shortest path is known as the geodesic curve. Only the longitude and the latitude of the two geodetic coordinates are taken into account.- Specified by:
geodesicDistance
in interfaceILcdEllipsoid
- Parameters:
aP1
- start point of geodesic line segment.aP2
- end point of geodesic line segment.- Returns:
- the shortest distance between
aP1
andaP2
on the ellipsoid in meters.
-
distanceToGeodesic
Calculates the distance between the geodesicaP1-aP2
and the pointaP3
, at a certain angleaAngle
. Returns result in degrees.The current implementation calculates the distance using a spherical approximation.
- Specified by:
distanceToGeodesic
in interfaceILcdEllipsoid
- Parameters:
aP1
- defining point of geodesic line.aP2
- defining point of geodesic line.aP3
- point from which the distance needs to be calculated.aAngle
- defines the angle between the geodesic lines defined by the pointaP3
and the point of crossing and the geodesic line defined byaP1
andaP2
and the point of crossing. Should be specified in degrees.- Returns:
- the distance in degrees.
- See Also:
-
distanceToGeodesic
public static double distanceToGeodesic(double aLon1, double aLat1, double aLon2, double aLat2, double aLon3, double aLat3, double aAngle) Calculates the distance between the geodesic(aLon1,aLat1)-(aLon2,aLat2)
and point(aLon3,aLat3)
, at a certain angleaAngle
. Returns result in degrees. Note: this method uses the spherical approximation fromTLspSphereUtil
, seeTLcdSphereUtil.distanceToGeodesic()
.- Parameters:
aLon1
- longitude of first end point of geodesic line.aLat1
- latitude of first end point of geodesic line.aLon2
- longitude of second end point of geodesic line.aLat2
- latitude of second end point of geodesic line.aLon3
- longitude of point from which the distance has to be calculated.aLat3
- latitude of point from which the distance has to be calculated.aAngle
- defines the angle between the geodesic defined by(aLon3,aLat3)
and the point of crossing and the geodesic defined by(aLon1,aLat1)
and(aLon2,aLat2)
.- Returns:
- the distance in degrees.
- See Also:
-
geodesicArea
Calculates the geodesic surface area of a polygon given as an array ofILcdPoint
objects. The segments of the polygon must not be self-intersecting. Only the longitude and latitude of the coordinates are taken into account.Constraint: (
aN
> 2) and (aPts.length
>aN
).This is an approximation based on the spherical formulae using a Gaussian radius. The value returned is always positive, regardless of the orientation of the points.
- Specified by:
geodesicArea
in interfaceILcdEllipsoid
- Parameters:
aPts
- an array ofILcdPoint
objects.aN
-aPts[0..aN-1]
defines the polygon on the ellipsoid.- Returns:
- the geodesic surface area of a polygon on the ellipsoid.
-
radiusGaussian
public double radiusGaussian(double aLat) Description copied from interface:ILcdEllipsoid
The Gaussian curvature radius is the geometric mean of the vertical and the meridional radius. See p. 78 of Coordinate Systems and Map Projections , 2nd edition, 1992, Maling. Often used as the basis for conformal spherical calculations.- Specified by:
radiusGaussian
in interfaceILcdEllipsoid
- Parameters:
aLat
- latitude, in degrees- Returns:
- the Gaussian curvature radius.
- See Also:
-
radiusGaussian
public double radiusGaussian(double aLat, double aSinLat) Description copied from interface:ILcdEllipsoid
The Gaussian curvature radius is the geometric mean of the vertical and the meridional radius. See p. 78 of Coordinate Systems and Map Projections , 2nd edition, 1992, Maling. Often used as the basis for conformal spherical calculations.- Specified by:
radiusGaussian
in interfaceILcdEllipsoid
- Parameters:
aLat
- latitude, in degreesaSinLat
- the sine of the latitude.- Returns:
- the Gaussian curvature radius.
- See Also:
-
radiusEuler
public double radiusEuler(double aLatitude, double aAzimuth) Description copied from interface:ILcdEllipsoid
Euler radius of the ellipsoid at a given latitudeaLatitude
and a given azimuthaAzimuth
. The euler radius is the mean radius of the spheroidal arc at the given latitude for the given azimuth.- Specified by:
radiusEuler
in interfaceILcdEllipsoid
- Parameters:
aLatitude
- latitude, in arc degrees.aAzimuth
- azimuth, in RADIANS .- Returns:
- the Euler radius of the ellipsoid at the given latitude.
- See Also:
-
radiusEuler
public double radiusEuler(double aLatitude, double aSinLat, double aAzimuth, double aCosAzimuth, double aSinAzimuth) Description copied from interface:ILcdEllipsoid
Euler radius of the ellipsoid at a given latitudeaLatitude
and a given azimuthaAzimuth
. The euler radius is the mean radius of the spheroidal arc at the given latitude for the given azimuth.- Specified by:
radiusEuler
in interfaceILcdEllipsoid
- Parameters:
aLatitude
- latitude, in arc degrees.aSinLat
- the sine of the latitude.aAzimuth
- azimuth, in RADIANS .aCosAzimuth
- the cosine of the azimuth.aSinAzimuth
- the sine of the azimuth.- Returns:
- the Euler radius of the ellipsoid at the given latitude.
-
forwardAzimuth2D
Calculates the forward azimuth of the geodesic line from
aP1
toaP2
in radians ! Only the (x,y) coordinates (longitude and latitude) of theILcdPoint
objects are taken into account.The forward azimuth lies between [0.0, 2.0*Math.PI], with 0.0 north, clockwise.
Implementation of Vincenty's formula.
- Specified by:
forwardAzimuth2D
in interfaceILcdEllipsoid
- Parameters:
aP1
- start point of the geodesic line segment.aP2
- end point of the geodesic line segment.- Returns:
- the forward azimuth from
aP1
toaP2
in radians! - See Also:
-
forwardAzimuth2D
public double forwardAzimuth2D(double aLon1, double aLat1, double aLon2, double aLat2) Description copied from interface:ILcdEllipsoid
Calculates the forward azimuth of the geodesic line from
aP1
toaP2
in radians ! Only the (x,y) coordinates (longitude and latitude) of theILcdPoint
objects are taken into account.The forward azimuth lies between [0.0, 2.0*Math.PI], with 0.0 north, clockwise.
- Specified by:
forwardAzimuth2D
in interfaceILcdEllipsoid
- Parameters:
aLon1
- longitude, in degrees, of the start point of the geodesic line segment.aLat1
- latitude, in degrees, of the start point of the geodesic line segment.aLon2
- longitude, in degrees, of the end point of the geodesic line segment.aLat2
- latitude, in degrees, of the end point of the geodesic line segment.- Returns:
- the forward azimuth from
(aLongitude1,aLatitude1)
to(aLongitude2,aLatitude2)
in radians!
-
geodesicPointSFCT
public void geodesicPointSFCT(ILcdPoint aP1, ILcdPoint aP2, double aK, ILcd2DEditablePoint aGeodesicPointSFCT) SetsaGeodesicPointSFCT
to anILcdPoint
on the geodesic line through the pointaP1
and the pointaP2
, located at a fractionaK
of the (shortest) distance betweenaP1
andaP2
.Implementation is based on the inverse and forward formulas of Vincenty.
- Specified by:
geodesicPointSFCT
in interfaceILcdEllipsoid
- Parameters:
aP1
- first 2D point on the ellipsoid[aP1.getX(), aP1.getY()]
.aP2
- second 2D point on the ellipsoid[aP2.getX(), aP2.getY()]
.aK
- fraction between 0.0 and 1.0.aGeodesicPointSFCT
- side effect parameter that contains the result upon return of the method.- See Also:
-
geodesicPointSFCT
public void geodesicPointSFCT(ILcdPoint aPoint, double aDistance, double aAzimuth, ILcd2DEditablePoint aGeodesicPointSFCT) Determines theILcdPoint
aGeodesicPoint
on the geodesic through(aP1.getX(), aP1.getY())
located at a distanceaDistance
and forward azimuthaAzimuth
.Vincenty's forward formula is implemented. This formula may be used for lines ranging from a few centimeter to nearly 20000km, with millimeter accuracy.
The implementation of Vincenty's forward formula is described in:
- Geocentric Datum of Australia: Technical Manual, available at http://www.icsm.gov.au/sites/default/files/2017-09/gda-v_2.4_0.pdf.
- Vincenty, T., Direct and inverse solutions of geodesics on the ellipsoid with application of nested equations, Survey Review XXII, 176, April 1975.
- Specified by:
geodesicPointSFCT
in interfaceILcdEllipsoid
- Parameters:
aPoint
-ILcdPoint
on the ellipsoid.aDistance
- distance expressed in meters. If the distance is smaller than 0, this method will return the input point as result.aAzimuth
- forward azimuth expressed in degrees.aGeodesicPointSFCT
- side effect parameter that contains the result upon return of the method.- See Also:
-
rhumblineAzimuth2D
Description copied from interface:ILcdEllipsoid
Calculates the azimuth of the rhumbline from
aP1
toaP2
in degrees! Only the (x,y) coordinates (longitude and latitude) of theILcdPoint
objects are taken into account.The forward azimuth lies between [0.0, 360.0], with 0.0 north, clockwise.
- Specified by:
rhumblineAzimuth2D
in interfaceILcdEllipsoid
- Parameters:
aP1
- start point of rhumbline segment.aP2
- end point of rhumbline segment.- Returns:
- the forward azimuth from
aP1
toaP2
in DEGREES!
-
rhumblineDistance
Description copied from interface:ILcdEllipsoid
Calculates the distance between two arbitraryILcdPoint
objectsaP1
andaP2
on the ellipsoid in meters following a path with constant azimuth. The curve that represents this path is known as the rhumbline. Only the longitude and the latitude of the two geodetic coordinates are taken into account.- Specified by:
rhumblineDistance
in interfaceILcdEllipsoid
- Parameters:
aP1
- start point of rhumbline segment.aP2
- end point of rhumbline segment.- Returns:
- the rhumbline distance between
aP1
andaP2
on the ellipsoid in meters.
-
rhumblinePointSFCT
public void rhumblinePointSFCT(ILcdPoint aPoint, double aDistance, double aAzimuth, ILcd2DEditablePoint aRhumblinePointSFCT) Description copied from interface:ILcdEllipsoid
Determines theILcdPoint
aRhumblinePointSFCT
on the rhumbline (a path with a constant bearing) through(aP1.getX(), aP1.getY())
located at a distanceaDistance
and forward azimuthaAzimuth
.- Specified by:
rhumblinePointSFCT
in interfaceILcdEllipsoid
- Parameters:
aPoint
-ILcdPoint
on the ellipsoid.aDistance
- distance expressed in meters.aAzimuth
- forward azimuth expressed in degrees.aRhumblinePointSFCT
-ILcdPoint
on the ellipsoid.
-
intersects2DLS
Checks whether two geodesic line segments intersect. Any intersection will always lie on both segments (i.e. between aP1 and aP2, and between aP3 and aP4).Refer to
TLcdEllipsoidUtil.intersectionGeodesicGeodesic(com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.geodesy.ILcdEllipsoid, com.luciad.shape.shape2D.ILcd2DEditablePoint)
for checking the intersection of entire geodesics.- Specified by:
intersects2DLS
in interfaceILcdEllipsoid
- Parameters:
aP1
- start point of the first line segment.aP2
- end point of the first line segment.aP3
- start point of the second line segment.aP4
- end point of the second line segment.- Returns:
true
if the segments intersect each other,false
otherwise.- See Also:
-
intersects2DLS
public boolean intersects2DLS(double aLon1, double aLat1, double aLon2, double aLat2, double aLon3, double aLat3, double aLon4, double aLat4) Checks whether two geodesic line segments with the given coordinates intersect. Any intersection will always lie on both segments (i.e. between the points(aLon1,aLat1)
and(aLon2,aLat2)
, and between(aLon3,aLat3)
and(aLon4,aLat4)
.Refer to
TLcdEllipsoidUtil.intersectionGeodesicGeodesic(com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.geodesy.ILcdEllipsoid, com.luciad.shape.shape2D.ILcd2DEditablePoint)
for checking the intersection of entire geodesics.- Specified by:
intersects2DLS
in interfaceILcdEllipsoid
- Parameters:
aLon1
- longitude of the start point of the first geodesic line segment.aLat1
- latitude of the start point of the first geodesic line segment.aLon2
- longitude of the end point of the first geodesic line segment.aLat2
- latitude of the end point of the first geodesic line segment.aLon3
- longitude of the start point of the first geodesic line segment.aLat3
- latitude of the start point of the first geodesic line segment.aLon4
- longitude of the end point of the first geodesic line segment.aLat4
- latitude of the end point of the first geodesic line segment.- Returns:
true
if geodesic line segments intersect each other,false
otherwise.- See Also:
-
intersection2DLSSFCT
public void intersection2DLSSFCT(ILcdPoint aP1, ILcdPoint aP2, ILcdPoint aP3, ILcdPoint aP4, ILcd2DEditablePoint aLLPSFCT) Calculates the intersection of two geodesic lines going containing the given coordinates. The intersection will always lie on both segments (i.e. between aP1 and aP2, and between aP3 and aP4).Refer to
TLcdEllipsoidUtil.intersectionGeodesicGeodesic(com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.geodesy.ILcdEllipsoid, com.luciad.shape.shape2D.ILcd2DEditablePoint)
for checking the intersection of entire geodesics.The points
aP1
andaP2
should not coincide nor should the pointsaP3
andaP4
. A RuntimeException is thrown in case the two geodesics overlap or do not intersect.- Specified by:
intersection2DLSSFCT
in interfaceILcdEllipsoid
- Parameters:
aP1
- start point of the first geodesic line segment.aP2
- end point of the first geodesic line segment.aP3
- start point of the second geodesic line segment.aP4
- end point of the second geodesic line segment.aLLPSFCT
- represents the intersection point on return of the method.
-
intersection2DLSSFCT
public void intersection2DLSSFCT(double aLon1, double aLat1, double aLon2, double aLat2, double aLon3, double aLat3, double aLon4, double aLat4, ILcd2DEditablePoint aLLPSFCT) Calculates the intersection of two geodesic lines going through the given coordinates. Any intersection will always lie on both segments (i.e. between the points(aLon1,aLat1)
and(aLon2,aLat2)
, and between(aLon3,aLat3)
and(aLon4,aLat4)
.Refer to
TLcdEllipsoidUtil.intersectionGeodesicGeodesic(com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.shape.ILcdPoint, com.luciad.geodesy.ILcdEllipsoid, com.luciad.shape.shape2D.ILcd2DEditablePoint)
for checking the intersection of entire geodesics.The points
(aLon1,aLat1)
and(aLon2,aLat2
should not coincide nor should the points(aLon3,aLat3)
and(aLon4,aLat4)
. A RuntimeException is thrown in case the two geodesics overlap or do not intersect.- Specified by:
intersection2DLSSFCT
in interfaceILcdEllipsoid
- Parameters:
aLon1
- longitude of the start point of the first geodesic line segment.aLat1
- latitude of the start point of the first geodesic line segment.aLon2
- longitude of the end point of the first geodesic line segment.aLat2
- latitude of the end point of the first geodesic line segment.aLon3
- longitude of the start point of the first geodesic line segment.aLat3
- latitude of the start point of the first geodesic line segment.aLon4
- longitude of the end point of the first geodesic line segment.aLat4
- latitude of the end point of the first geodesic line segment.aLLPSFCT
- represents the intersection point on return of the method.
-
bufferContour2DOfSegmentSFCT
public void bufferContour2DOfSegmentSFCT(ILcdPoint aStartPoint, ILcdPoint aEndPoint, double aWidth, ILcd2DEditablePoint[] a2DEditablePointArraySFCT) Calculates the contour of the rectangle defined byaStartPoint
,aEndPoint
, andaWidth
, as an array of 4ILcd2DEditablePoint
objects. The ordering of the points of the contour is clockwise starting from the first point of the rectangle.Because there are only 4 points used to define the contour, the contour representation becomes less accurate when the start and end point are further removed from each other: the connected contour lines no longer lie at the given distance from the axis at each intermediate point. For a more accurate calculation of a buffer contour that uses additional contour points if necessary, please refer to
TLcdEllipsoidUtil#computeBufferContour2D
.Uses
TLcdSphereUtil.bufferContour2DOfSegmentSFCT(aStartPoint,aEndPoint,aWidth,getA(),a2DEditablePointArraySFCT)
.- Specified by:
bufferContour2DOfSegmentSFCT
in interfaceILcdEllipsoid
- Parameters:
aStartPoint
- start point of buffer segment.aEndPoint
- end point of buffer segment.aWidth
- distance from the line segment to the contour in meters.a2DEditablePointArraySFCT
- an initialized array of 4ILcd2DEditablePoint
objects, which will represent the contour polygon.- See Also:
-
bufferContour2DOf2DPolylineSFCT
public void bufferContour2DOf2DPolylineSFCT(ILcdPointList aPointList, double aWidth, ILcd2DEditablePoint[] a2DEditablePointArraySFCT) Calculates the contour of the buffer/corridor along a givenILcdPointList
at a given width. The ordering of the points of the contour is clockwise starting from the first point of the rectangle.This implementation has the following limitations:
- contours with holes (i.e., caused by axis intersections) cannot
be represented, since the contour is modeled as an
ILcd2DEditablePoint
array, - the corners of the contour at the axis points are sharp instead of rounded, which make it less suitable for buffers that have sharp angles between its consecutive axis segments; it has also has as consequence that the distance between the contour and the axis exceeds the given buffer distance in the corners,
- the calculated contour is only an estimate, because it uses a reduced number of contour points; when the start and end point of a segment are further removed from each other, the connected contour lines no longer lie at the given distance from the axis at each intermediate point.
TLcdEllipsoidUtil#computeBufferContour2D
.Uses
TLcdSphereUtil.bufferContour2DOf2DPolyline(aStartPoint,aEndPoint,aWidth,getA(),a2DEditablePointArraySFCT)
.- Specified by:
bufferContour2DOf2DPolylineSFCT
in interfaceILcdEllipsoid
- Parameters:
aPointList
- the axis of the buffer.aWidth
- distance from the axis to the contour in meters.a2DEditablePointArraySFCT
- an initialized array ofaPointList.getPointCount() * 2
ILcd2DEditablePoint
objects, which will represent the contour polygon.- See Also:
- contours with holes (i.e., caused by axis intersections) cannot
be represented, since the contour is modeled as an
-
getName
Description copied from interface:ILcdEllipsoid
Gets the name of thisILcdEllipsoid
.- Specified by:
getName
in interfaceILcdEllipsoid
- Returns:
- the name of this
ILcdEllipsoid
.
-
setName
Sets the name of this ellipsoid.- Parameters:
aName
- name of the ellipsoid represented by thisILcdEllipsoid
.- See Also:
-
equals
Description copied from interface:ILcdEllipsoid
Overrides Object.equals.- Specified by:
equals
in interfaceILcdEllipsoid
- Overrides:
equals
in classObject
- Parameters:
aEllipsoid
- Object to be checked on.- Returns:
- true if both objects are equal.
-
hashCode
public int hashCode() -
toString
-