public class LocationVector extends Object
Locations. Internally, this vector is defined by the azimuth
(bearing) and the horizontal and vertical separation between the points. Note
that a LocationVector from point A to point B is not the complement
of that from point B to A. Although the horizontal and vertical components
will be the same, the azimuth will likely change by some value other than
180°.
NOTE: Although a LocationVector will function in any
reference frame, the convention in seismology and that adopted in OpenSHA is
for depth to be positive down. Also, azimuth is stored internally in radians
for computational convenience. Be sure to use the azimuth()
(radians) or // azimuthDegrees() (decimal-degrees) where
appropriate.
| Modifier and Type | Method and Description |
|---|---|
double |
azimuth()
Returns the azimuth of this vector in radians.
|
double |
azimuthDegrees()
Returns the azimuth of this vector in decimal degrees.
|
static LocationVector |
create(double azimuth,
double horizontal,
double vertical)
Initializes a new
LocationVector with the supplied values. |
static LocationVector |
create(Location p1,
Location p2)
Returns the
LocationVector describing the move from one
Location to another. |
static LocationVector |
createWithPlunge(double azimuth,
double plunge,
double length)
Creates a new
LocationVector with horizontal and vertical
components derived from the supplied plunge and length. |
double |
horizontal()
Returns the horizontal component of this vector.
|
double |
plunge()
Returns the angle (in radians) between this vector and a horizontal plane.
|
double |
plungeDegrees()
Returns the angle (in decimal degrees) between this vector and a horizontal
plane.
|
static LocationVector |
reverseOf(LocationVector v)
Returns a copy of the supplied vector with azimuth and vertical components
reversed.
|
String |
toString() |
double |
vertical()
Returns the vertical component of this vector.
|
public static LocationVector create(double azimuth, double horizontal, double vertical)
LocationVector with the supplied values. Note
that azimuth is expected in radians.azimuth - to set in radianshorizontal - component to set in kmvertical - component to set in kmLocationVectorpublic static LocationVector createWithPlunge(double azimuth, double plunge, double length)
LocationVector with horizontal and vertical
components derived from the supplied plunge and length.
Note that azimuth and plunge are expected in
radians.azimuth - to set in radiansplunge - to set in radianslength - of vector in kmLocationVectorpublic static LocationVector create(Location p1, Location p2)
LocationVector describing the move from one
Location to another.p1 - the first Locationp2 - the second LocationLocationVectorpublic static LocationVector reverseOf(LocationVector v)
NOTE: create(p1, p2) is not equivalent to create reverseOf(create(p2, p1)). Although the horizontal and vertical components will likley be the same but the azimuths will potentially be different.
v - LocationVector to copy and flippublic double azimuthDegrees()
azimuth()public double azimuth()
azimuthDegrees()public double plunge()
public double plungeDegrees()
public double vertical()
public double horizontal()