version  0.0.1
Defines the C++ API for MsPASS
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. More...
 
 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.

11 {
12  ux=0.0;
13  uy=0.0;
14  azimuth0=0.0;
15 }
double uy
Definition: SlownessVector.h:27
double ux
Definition: SlownessVector.h:23

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)
23 {
24  ux=ux0;
25  uy=uy0;
26  azimuth0=az0;
27 }

References ux, and uy.

◆ SlownessVector() [3/3]

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

Copy constructor.

17 {
18  ux=old.ux;
19  uy=old.uy;
20  azimuth0=old.azimuth0;
21 }

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.

68 {
69  if(this->mag() <= FLT_EPSILON) return(azimuth0);
70  double phi;
71  phi=M_PI_2-atan2(uy,ux);
72  if(phi>M_PI)
73  return(phi-2.0*M_PI);
74  else if(phi<-M_PI)
75  return(phi+2.0*M_PI);
76  else
77  return(phi);
78 }
double mag() const noexcept
Definition: SlownessVector.cc:63

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.

80 {
81  double phi;
82  if(this->mag() <= FLT_EPSILON)
83  phi=M_PI-azimuth0;
84  else
85  phi=3.0*M_PI_2-atan2(uy,ux);
86  if(phi>M_PI)
87  return(phi-2.0*M_PI);
88  else if(phi<-M_PI)
89  return(phi+2.0*M_PI);
90  else
91  return(phi);
92 }

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.

64 {
65  return(hypot(ux,uy));
66 }

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: