|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.geo.LocationVector
public class LocationVector
This class encapsulates information describing a vector between two
Locations. This vector is defined by the azimuth (bearing) from
a point p1 to a point p2, and also by 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.
| Constructor Summary | |
|---|---|
LocationVector()
Initializes a new LocationVector with azimuth and horizontal
and vertical components all initialized to 0. |
|
LocationVector(double azimuth,
double horizontal,
double vertical)
Initializes a new LocationVector with the supplied values. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
double |
getAzimuth()
Returns the azimuth of this LocationVector in decimal
degrees. |
double |
getAzimuthRad()
Returns the azimuth of this LocationVector in radians. |
double |
getHorzDistance()
Gets the horizontal component of this LocationVector. |
double |
getPlunge()
Returns the angle (in decimal degrees) between this vector and the horizontal based on the current internal vertical and horizontal separation values. |
double |
getVertDistance()
Gets the vertical component of this LocationVector. |
void |
reverse()
Reverses the azimuth (to 'back-azimuth') and flips the sign of the vertical component of this LocationVector. |
void |
set(double azimuth,
double horizontal,
double vertical)
Sets this LocationVector's internal fields to the supplied
values. |
void |
setAzimuth(double azimuth)
Sets the azimuth of this LocationVector. |
void |
setHorzDistance(double horizontal)
Sets the horizontal component of this LocationVector. |
void |
setVertDistance(double vertical)
Sets the vertical component of this LocationVector. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LocationVector()
LocationVector with azimuth and horizontal
and vertical components all initialized to 0.
public LocationVector(double azimuth,
double horizontal,
double vertical)
LocationVector with the supplied values.
Note that azimuth is expected in decimal degrees.
azimuth - value to set in decimal degreeshorizontal - component value to setvertical - component value to set| Method Detail |
|---|
public void set(double azimuth,
double horizontal,
double vertical)
LocationVector's internal fields to the supplied
values. Note that azimuth is expected in decimal
degrees.
azimuth - value to set in decimal degreeshorizontal - component value to setvertical - component value to setpublic void reverse()
LocationVector.
public double getAzimuth()
LocationVector in decimal
degrees.
getAzimuthRad()public double getAzimuthRad()
LocationVector in radians.
getAzimuth()public void setAzimuth(double azimuth)
LocationVector.
azimuth - value to set in decimal degreespublic double getPlunge()
public double getVertDistance()
LocationVector.
public void setVertDistance(double vertical)
LocationVector.
vertical - component value to set in kmpublic double getHorzDistance()
LocationVector.
public void setHorzDistance(double horizontal)
LocationVector.
horizontal - component value to set in kmpublic String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||