Package edu.sc.seis.TauP
Class SphericalCoords
java.lang.Object
edu.sc.seis.TauP.SphericalCoords
Utility class for spherical coordinate (lat-lon) transformations. Given lat,
lon, lat, lon you can find the distance or azimuth and given lat, lon,
distance, azimuth you can find the lat lon of the resultant point. Just uses
spherical relations, no ellpticity correction is applied.
See Appendix A of "Seismology and Plate Tectonics" by David Gubbins Cambridge University Press, 1990
and Chapter 3 of "Plate Tectonics: How it Works" by Allan Cox and Robert Brian Hart Blackwell Scientific Publications, 1986
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final doublestatic final doublestatic final net.sf.geographiclib.Geodesicstatic final doubleprotected static final doublestatic final doublestatic final double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleazimuth(double latA, double lonA, double latB, double lonB) Calculates azimuth between two lat lon pairs.static doubleazimuth(edu.sc.seis.seisFile.LatLonLocatable a, edu.sc.seis.seisFile.LatLonLocatable b) static doubleazimuth(edu.sc.seis.seisFile.Location a, edu.sc.seis.seisFile.Location b) static doubledistance(double latA, double lonA, double latB, double lonB) Calculates angular distance between two lat lon pairs.static doubledistance(edu.sc.seis.seisFile.Location a, edu.sc.seis.seisFile.Location b) static doubledistanceRadian(double latA, double lonA, double latB, double lonB) static doubledistanceRadian(edu.sc.seis.seisFile.Location a, edu.sc.seis.seisFile.Location b) static doubledistanceTrim180(double deg) static doublegetModuloDistRadian(double distRadian) returns distance in radians and in the range 0-PI.static double[]greatCircleRotationPole(double lat, double lon, double azimuth) static doublelatFor(double latA, double lonA, double distance, double azimuth) Calculates the latitude of a point a given distance along a given azimuth from a starting lat lon.static doublelatFor(edu.sc.seis.seisFile.Location a, double distance, double azimuth) Calculates the latitude of a point a given distance along a given azimuth from a starting lat lon.static double[]latLonFromXYZ(double[] xyz) static doublelonFor(double latA, double lonA, double distance, double azimuth) Calculates the longitude of a point a given distance along a given azimuth from a starting lat lon.static doublelonFor(edu.sc.seis.seisFile.Location a, double distance, double azimuth) Calculates the latitude of a point a given distance along a given azimuth from a starting lat lon.static double[]rotate(double latA, double lonA, double[] pole, double angleDeg) rotates a point about a pole by an angle.static double[]rotationPole(double latA, double lonA, double latB, double lonB) Find the rotation pole required to rotate the first lat lon pair to the second.static double[]xyzFromLatLonRadius(double lat, double lon, double radius)
-
Field Details
-
dtor
protected static final double dtor- See Also:
-
DtoR
public static final double DtoR- See Also:
-
ONE_DEG_AS_RADIAN
public static final double ONE_DEG_AS_RADIAN- See Also:
-
rtod
protected static final double rtod- See Also:
-
RtoD
public static final double RtoD- See Also:
-
TWOPI
public static final double TWOPI- See Also:
-
EARTH_SPHERE
public static final net.sf.geographiclib.Geodesic EARTH_SPHERE
-
-
Constructor Details
-
SphericalCoords
public SphericalCoords()
-
-
Method Details
-
distance
public static double distance(double latA, double lonA, double latB, double lonB) Calculates angular distance between two lat lon pairs. -
distanceRadian
public static double distanceRadian(double latA, double lonA, double latB, double lonB) -
distanceRadian
public static double distanceRadian(edu.sc.seis.seisFile.Location a, edu.sc.seis.seisFile.Location b) -
distance
public static double distance(edu.sc.seis.seisFile.Location a, edu.sc.seis.seisFile.Location b) -
azimuth
public static double azimuth(double latA, double lonA, double latB, double lonB) Calculates azimuth between two lat lon pairs. -
azimuth
public static double azimuth(edu.sc.seis.seisFile.LatLonLocatable a, edu.sc.seis.seisFile.LatLonLocatable b) -
azimuth
public static double azimuth(edu.sc.seis.seisFile.Location a, edu.sc.seis.seisFile.Location b) -
getModuloDistRadian
public static double getModuloDistRadian(double distRadian) returns distance in radians and in the range 0-PI. Note this may not be the actual distance traveled. -
distanceTrim180
public static double distanceTrim180(double deg) -
rotationPole
public static double[] rotationPole(double latA, double lonA, double latB, double lonB) Find the rotation pole required to rotate the first lat lon pair to the second. Just does a cross product.- Returns:
- a 3 element double array with the X, Y and Z components of the pole.
-
rotate
public static double[] rotate(double latA, double lonA, double[] pole, double angleDeg) rotates a point about a pole by an angle.- Parameters:
pole- is a 3 element double array with X, Y and Z components of the pole.- Returns:
- [lat, lon] in array.
-
latFor
public static double latFor(edu.sc.seis.seisFile.Location a, double distance, double azimuth) Calculates the latitude of a point a given distance along a given azimuth from a starting lat lon. -
latFor
public static double latFor(double latA, double lonA, double distance, double azimuth) Calculates the latitude of a point a given distance along a given azimuth from a starting lat lon. -
lonFor
public static double lonFor(edu.sc.seis.seisFile.Location a, double distance, double azimuth) Calculates the latitude of a point a given distance along a given azimuth from a starting lat lon. -
lonFor
public static double lonFor(double latA, double lonA, double distance, double azimuth) Calculates the longitude of a point a given distance along a given azimuth from a starting lat lon. -
latLonFromXYZ
public static double[] latLonFromXYZ(double[] xyz) -
xyzFromLatLonRadius
public static double[] xyzFromLatLonRadius(double lat, double lon, double radius) -
greatCircleRotationPole
public static double[] greatCircleRotationPole(double lat, double lon, double azimuth)
-