version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
mspass::seismic::SlownessVector Class Reference

Slowness vector object. More...

#include <SlownessVector.h>

Public Member Functions

 SlownessVector ()
 
 SlownessVector (const double ux0, const double uy0, const double az0=0.0)
 Fully parameterized constructor.
 
 SlownessVector (const SlownessVector &)
 
double mag () const noexcept
 
double azimuth () const noexcept
 
double baz () const noexcept
 
SlownessVectoroperator= (const SlownessVector &parent)
 Standard assignment operator.
 
SlownessVectoroperator+= (const SlownessVector &other)
 
SlownessVectoroperator-= (const SlownessVector &other)
 
const SlownessVector operator+ (const SlownessVector &other) const
 
const SlownessVector operator- (const SlownessVector &other) const
 

Public Attributes

double ux
 
double uy
 

Friends

class boost::serialization::access
 

Detailed Description

Slowness vector object.

Slowness vectors are a seismology concept used to describe wave propagation. A slowness vector points in the direction of propagation of a wave with a magnitude equal to the slowness (1/velocity) of propagation.

Author
Gary L. Pavlis

Constructor & Destructor Documentation

◆ SlownessVector() [1/3]

mspass::seismic::SlownessVector::SlownessVector ( )

Default constructor.

9 {
10 ux = 0.0;
11 uy = 0.0;
12 azimuth0 = 0.0;
13}
double uy
Definition SlownessVector.h:25
double ux
Definition SlownessVector.h:21

References ux, and uy.

◆ SlownessVector() [2/3]

mspass::seismic::SlownessVector::SlownessVector ( const double  ux0,
const double  uy0,
const double  az0 = 0.0 
)

Fully parameterized constructor.

A slowness vector is defined by it's components. There is one ambiguity, however, with a zero slowness vector. That is, normally direction of propagation is inferred from the vector azimuth. A zero slowness vector has physical significance (normal incidence) but presents and ambiguity in this regard. We use a defaulted az0 parameter to specify the azimuth that should be used if the magnitude of slowness vector is 0.

Parameters
ux0- set x (EW) component to this value.
uy0- set y (NS) component to this value.
az0- use this as azimuth (radians) if this is a zero slowness vector (default 0.0)
20 {
21 ux = ux0;
22 uy = uy0;
23 azimuth0 = az0;
24}

References ux, and uy.

◆ SlownessVector() [3/3]

mspass::seismic::SlownessVector::SlownessVector ( const SlownessVector old)

Copy constructor.

14 {
15 ux = old.ux;
16 uy = old.uy;
17 azimuth0 = old.azimuth0;
18}

References ux, and uy.

Member Function Documentation

◆ azimuth()

double mspass::seismic::SlownessVector::azimuth ( ) const
noexcept

Returns the propagation direction defined by a slowness vector. Azimuth is a direction clockwise from north in the standard geographic convention. Value returned is in radians.

59 {
60 if (this->mag() <= FLT_EPSILON)
61 return (azimuth0);
62 double phi;
63 phi = M_PI_2 - atan2(uy, ux);
64 if (phi > M_PI)
65 return (phi - 2.0 * M_PI);
66 else if (phi < -M_PI)
67 return (phi + 2.0 * M_PI);
68 else
69 return (phi);
70}
double mag() const noexcept
Definition SlownessVector.cc:58

References mag(), ux, and uy.

◆ baz()

double mspass::seismic::SlownessVector::baz ( ) const
noexcept

Returns the back azimuth direction defined by a slowness vector. A back azimuth is 180 degrees away from the direction of propagation and points along the great circle path directed back to the source point from a given position. The value returned is in radians.

71 {
72 double phi;
73 if (this->mag() <= FLT_EPSILON)
74 phi = M_PI - azimuth0;
75 else
76 phi = 3.0 * M_PI_2 - atan2(uy, ux);
77 if (phi > M_PI)
78 return (phi - 2.0 * M_PI);
79 else if (phi < -M_PI)
80 return (phi + 2.0 * M_PI);
81 else
82 return (phi);
83}

References mag(), ux, and uy.

◆ mag()

double mspass::seismic::SlownessVector::mag ( ) const
noexcept

Computes the magntitude of the slowness vector. Value returned is in units of seconds/kilometer.

58{ return (hypot(ux, uy)); }

References ux, and uy.

◆ operator+()

const SlownessVector mspass::seismic::SlownessVector::operator+ ( const SlownessVector other) const
44 {
45 SlownessVector result(*this);
46 result += other;
47 return result;
48}
SlownessVector()
Definition SlownessVector.cc:9

◆ operator+=()

SlownessVector & mspass::seismic::SlownessVector::operator+= ( const SlownessVector other)
33 {
34 ux += other.ux;
35 uy += other.uy;
36 return (*this);
37}

◆ operator-()

const SlownessVector mspass::seismic::SlownessVector::operator- ( const SlownessVector other) const
50 {
51 SlownessVector result(*this);
52 result -= other;
53 return result;
54}

◆ operator-=()

SlownessVector & mspass::seismic::SlownessVector::operator-= ( const SlownessVector other)
38 {
39 ux -= other.ux;
40 uy -= other.uy;
41 return (*this);
42}

◆ operator=()

SlownessVector & mspass::seismic::SlownessVector::operator= ( const SlownessVector parent)

Standard assignment operator.

25 {
26 if (this != &parent) {
27 ux = parent.ux;
28 uy = parent.uy;
29 azimuth0 = parent.azimuth0;
30 }
31 return (*this);
32}

References ux, and uy.

Member Data Documentation

◆ ux

double mspass::seismic::SlownessVector::ux

East-west component of slowness vector.

◆ uy

double mspass::seismic::SlownessVector::uy

North-south component of slowness vector.


The documentation for this class was generated from the following files: