Geophysical Inversion and Modelling Library  v1.3.1-2-g7599abf9
GIMLI::Pos Class Reference

3 dimensional vector More...

+ Inheritance diagram for GIMLI::Pos:

Public Member Functions

 Pos ()
 
 Pos (bool valid)
 
 Pos (double x, double y)
 
 Pos (double x, double y, double z)
 
 Pos (const Pos &pos)
 
Posoperator= (const Pos &pos)
 
Posoperator= (const Vector< double > &v)
 
double & operator[] (Index i)
 
const double & operator[] (Index i) const
 
Pos operator- () const
 
void setValid (bool valid)
 
bool valid () const
 
void assign (const double &x, const double &y, const double &z)
 
const double & x () const
 
const double & y () const
 
const double & z () const
 
void setX (double x)
 
void setY (double y)
 
void setZ (double z)
 
void setVal (const double &val, Index i)
 
const double & getVal (Index i) const
 
Posround (double tol)
 
double distSquared (const Pos &p) const
 
double dist (const Pos &p) const
 
double distance (const Pos &p) const
 
double distSquared () const
 
double abs () const
 
double length () const
 
double angle (const Pos &p) const
 
double angle (const RVector3 &p1, const RVector3 &p3) const
 
double dot (const Pos &p) const
 
double sum () const
 
Pos norm (const Pos &p1, const Pos &p2) const
 
Pos norm () const
 
Posnormalize ()
 
Posnormalise ()
 
Pos cross (const Pos &p) const
 
Pos normXY (const Pos &p) const
 
template<class Matrix >
Postransform (const Matrix &wm)
 
PosrotateX (double phi)
 
PosrotateY (double phi)
 
PosrotateZ (double phi)
 
Posrotate (const RVector3 &r)
 
Posrotate (double phiX, double phiY, double phiZ)
 
Posscale (const RVector3 &s)
 
Postranslate (const RVector3 &t)
 
Postranslate (double x, double y=0.0, double z=0.0)
 
RVector vec () const
 
Index hash () const
 
void swap (Index i, Index j)
 

Protected Member Functions

void copy_ (const Pos &pos)
 

Protected Attributes

bool valid_
 
double mat_ [3]
 

Detailed Description

3 dimensional vector

3 dimensional vector

Constructor & Destructor Documentation

◆ Pos() [1/2]

GIMLI::Pos::Pos ( )
inline

Construct an empty in 3d at (0, 0, 0)

◆ Pos() [2/2]

GIMLI::Pos::Pos ( bool  valid)
inline

Construct an empty in 3d at (0, 0, 0). Optional set valid flag.

Member Function Documentation

◆ abs()

double GIMLI::Pos::abs ( ) const
inline

Return the length of this position vector, same as length.

Referenced by GIMLI::Shape::isInside(), GIMLI::Shape::plane(), and GIMLI::Shape::xyz2rst().

◆ angle() [1/2]

double GIMLI::Pos::angle ( const Pos p) const

Return the angle between (this, (origin), p).

◆ angle() [2/2]

double GIMLI::Pos::angle ( const RVector3 p1,
const RVector3 p3 
) const

Return the angle between (p1, this, p2).

◆ dist()

double GIMLI::Pos::dist ( const Pos p) const
inline

Return the distance to p.

Referenced by GIMLI::Shape::touch().

◆ distance()

double GIMLI::Pos::distance ( const Pos p) const
inline

◆ distSquared() [1/2]

double GIMLI::Pos::distSquared ( ) const
inline

Return the squared length of this position vector.

◆ distSquared() [2/2]

double GIMLI::Pos::distSquared ( const Pos p) const
inline

Return the squared distance to p.

◆ getVal()

const double& GIMLI::Pos::getVal ( Index  i) const
inline

Get a value. Throws out of range exception if index check fails.

◆ length()

double GIMLI::Pos::length ( ) const
inline

Return the length of this position vector.

◆ norm()

Pos GIMLI::Pos::norm ( ) const
inline

Return normalised copy of this Pos.

◆ normalise()

Pos& GIMLI::Pos::normalise ( )
inline

DEPRECATED Normalise for backward compatibility.

◆ normalize()

Pos& GIMLI::Pos::normalize ( )
inline

Normalize this Pos and return itself.

◆ operator=() [1/2]

Pos& GIMLI::Pos::operator= ( const Pos pos)
inline

Assignment operator

◆ operator=() [2/2]

Pos& GIMLI::Pos::operator= ( const Vector< double > &  v)
inline

Assignment operator

◆ round()

Pos& GIMLI::Pos::round ( double  tol)
inline

Inline round to tol.

◆ setVal()

void GIMLI::Pos::setVal ( const double &  val,
Index  i 
)
inline

Set a value. Throws out of range exception if index check fails.

◆ swap()

void GIMLI::Pos::swap ( Index  i,
Index  j 
)
inline

Swap coordinates i and j [0..3)