public final class UnitSphere extends JPoint3DD
Constructor and Description |
---|
UnitSphere(double x, double y)
Create this UnitSphere equivalent to the given long/lat point.
|
UnitSphere(double x, double y, double z)
Creates a normalized (x, y, z) (unless they are all zero, in which case creates (0, 0, 0)).
|
UnitSphere(JPoint2DD pt2D)
Create this UnitSphere equivalent to the given long/lat point.
|
UnitSphere(JPoint3DD pt)
Creates a 3D vector on the unit sphere as a normalized copy of the passed 3D point.
|
Modifier and Type | Method and Description |
---|---|
JPoint2DD |
computeLongLat()
Compute and return the long/lat equivalent to this unit-sphere point.
|
static double |
distancePtLineRadians(UnitSphere pt, UnitSphere a, UnitSphere b)
Return the distance on the unit sphere (an angle) between a point and a great-circle line segment.
|
static double |
distanceRadians(UnitSphere a, UnitSphere b)
Distance on the unit sphere between two points.
|
boolean |
equals(java.lang.Object obj)
Equality is based on the (x, y, z) values.
|
JPoint2DD |
getLongLat()
Retuns original long/lat equivalent of this UnitSphere, or if none, computes one.
|
static JPoint3DD |
greatCircle(UnitSphere a, UnitSphere b)
Compute the great circle through two points, and return it as the vector perpindicular to the plane through the two points and the center of the earth.
|
int |
hashCode() |
static UnitSphere |
intersect(JPoint3DD GCa, JPoint3DD GCb)
Return the intersection of two great-circles.
|
static UnitSphere |
intersect(UnitSphere a1, UnitSphere a2, UnitSphere b1, UnitSphere b2)
Return an intersection of two great-circle segments, or null if none.
|
static UnitSphere |
nearestPtLine(UnitSphere pt, UnitSphere a, UnitSphere b)
Return a point on great-circle segment ab that is closest to pt.
|
java.lang.String |
toString() |
public UnitSphere(double x, double y)
x
- longitude in degreesy
- latitude in degreespublic UnitSphere(JPoint2DD pt2D)
pt2D
- (Longitude, latitude) in degrees.public UnitSphere(double x, double y, double z)
x
-y
-z
-public UnitSphere(JPoint3DD pt)
pt
-public static double distanceRadians(UnitSphere a, UnitSphere b)
a
-b
-public static JPoint3DD greatCircle(UnitSphere a, UnitSphere b)
a
-b
-public static UnitSphere intersect(JPoint3DD GCa, JPoint3DD GCb)
GCa
- a vector perpindicular to one great-circle cut through the earthGCb
- a vector perpindicular to the other great circle.public static UnitSphere intersect(UnitSphere a1, UnitSphere a2, UnitSphere b1, UnitSphere b2)
Does not reliably find endpoint-on-segment intersections; test for those separately.
a1
- (a1, a2) is the first segmenta2
-b1
- (b1, b2) is the second segmentb2
-public static double distancePtLineRadians(UnitSphere pt, UnitSphere a, UnitSphere b)
pt
-a
-b
-public static UnitSphere nearestPtLine(UnitSphere pt, UnitSphere a, UnitSphere b)
pt
-a
-b
-public JPoint2DD getLongLat()
public JPoint2DD computeLongLat()
public boolean equals(java.lang.Object obj)