MVPosition.h

Classes

MVPosition -- A 3D vector in space (full description)

class MVPosition : public MeasValue

Interface

Public Members
MVPosition()
MVPosition(const MVPosition &other)
MVPosition(Double in0, Double in1, Double in2)
explicit MVPosition(Double in0)
MVPosition(const Quantity &l)
MVPosition(const Quantity &l, Double angle0, Double angle1)
MVPosition(const Quantity &l, const Quantity &angle0, const Quantity &angle1)
MVPosition(const Quantum<Vector<Double> > &angle)
MVPosition(const Quantity &l, const Quantum<Quantum<Double> > &angle)
explicit MVPosition(const Vector<Double> &other)
MVPosition(const Vector<Quantity> &other)
MVPosition &operator=(const MVPosition &other)
~MVPosition()
Double operator*(const MVPosition &other) const
Bool operator== (const MVPosition &other) const
Bool operator!= (const MVPosition &other) const
Bool near(const MVPosition &other, Double tol=1e-13) const
Bool near(const MVPosition &other, Quantity tol) const
Bool nearAbs(const MVPosition &other, Double tol=1e-13) const
MVPosition operator-() const
MVPosition &operator+=(const MVPosition &right)
MVPosition operator+(const MVPosition &right) const
MVPosition &operator-=(const MVPosition &right)
MVPosition operator-(const MVPosition &right) const
MVPosition &operator*=(const RotMatrix &right)
MVPosition &operator*=(Double right)
Double &operator()(uInt which)
const Double &operator()(uInt which) const
virtual uInt type() const
static void assure(const MeasValue &in)
virtual void adjust()
virtual void adjust(Double &res)
virtual void readjust(Double res)
virtual Double radius()
Vector<Double> get() const
const Vector<Double> &getValue() const
Quantum<Vector<Double> > getAngle() const
Quantum<Vector<Double> > getAngle(const Unit &unit) const
Double getLong() const
Quantity getLong(const Unit &unit) const
Double getLat() const
Quantity getLat(const Unit &unit) const
Quantity getLength() const
Quantity getLength(const Unit &unit) const
Double positionAngle(const MVPosition &other) const
Quantity positionAngle(const MVPosition &other, const Unit &unit) const
Double separation(const MVPosition &other) const
Quantity separation(const MVPosition &other, const Unit &unit) const
MVPosition crossProduct(const MVPosition &other) const
virtual void print(ostream &os) const
virtual MeasValue *clone() const
virtual Vector<Double> getVector() const
virtual void putVector(const Vector<Double> &in)
virtual Vector<Quantum<Double> > getRecordValue() const
virtual Vector<Quantum<Double> > getXRecordValue() const
virtual Vector<Quantum<Double> > getTMRecordValue() const
virtual Bool putValue(const Vector<Quantum<Double> > &in)
Protected Members
Double getLat(Double ln) const

Description

Review Status

Reviewed By:
tcornwel
Date Reviewed:
1996/02/22
Programs:
Tests:

Prerequisite

Etymology

From Measure, Value and Position

Synopsis

A MVPosition is a 3-vector of positions in a rectangular frame with internal units of m.
It can be constructed with: A void adjust(Double) function normalises the vector to a length of 1; a get() returns as a Double 3-vector the length and angles of the position vector; a getAngle() returns a Quantum 2-vector, (uInt) returns the indicated element, and getValue returns the vector.
Positions can be added and subtracted.
The multiplication of two positions produces the in-product.

Example

See Mposition class.

Motivation

To do coordinate transformations

To Do

Member Description

MVPosition()

Default constructor generates a (0,0,0) position

MVPosition(const MVPosition &other)

Copy constructor

MVPosition(Double in0, Double in1, Double in2)

Creates a specified vector

explicit MVPosition(Double in0)
MVPosition(const Quantity &l)

Creates a vector with specified length towards pole

MVPosition(const Quantity &l, Double angle0, Double angle1)

Creates the position from specified (azimuth,elevation) angles and length

MVPosition(const Quantum<Vector<Double> > &angle)

Creates the position from specified angles and length. or positions

Thrown Exceptions

If not enough angles: pole assumed (if none), or elevation =0 (if 1)

MVPosition(const Quantity &l, const Quantity &angle0, const Quantity &angle1)
MVPosition(const Quantity &l, const Quantum<Quantum<Double> > &angle)

Creates the position from specified angles and length. or positions

Thrown Exceptions

explicit MVPosition(const Vector<Double> &other)
MVPosition(const Vector<Quantity> &other)

Create from specified length and/or angles and/or position

MVPosition &operator=(const MVPosition &other)

Copy assignment

~MVPosition()

Destructor

Double operator*(const MVPosition &other) const

Multiplication defined as in-product

Bool operator== (const MVPosition &other) const
Bool operator!= (const MVPosition &other) const
Bool near(const MVPosition &other, Double tol=1e-13) const
Bool near(const MVPosition &other, Quantity tol) const
Bool nearAbs(const MVPosition &other, Double tol=1e-13) const

Equality comparisons

MVPosition operator-() const
MVPosition &operator+=(const MVPosition &right)
MVPosition operator+(const MVPosition &right) const
MVPosition &operator-=(const MVPosition &right)
MVPosition operator-(const MVPosition &right) const

Addition and subtraction

MVPosition &operator*=(const RotMatrix &right)

Multiplication with rotation matrix (see also global functions)

MVPosition &operator*=(Double right)

Multiplication with constant

Double &operator()(uInt which)
const Double &operator()(uInt which) const

Obtain an element

virtual uInt type() const
static void assure(const MeasValue &in)

Tell me your type

virtual void adjust(Double &res)

Normalise direction aspects by adjusting the length to 1

Adjustment with returned factor

virtual void readjust(Double res)

Normalise direction aspects by adjusting the length to 1

Re-adjust using factor given

virtual void adjust()

Normalise direction aspects by adjusting the length to 1

virtual Double radius()

Get radius of position

Vector<Double> get() const

Generate a 3-vector of coordinates (length(m), angles(rad))

const Vector<Double> &getValue() const

Generate a 3-vector of x,y,z in m

Quantum<Vector<Double> > getAngle() const

Generate angle 2-vector (in rad)

Quantum<Vector<Double> > getAngle(const Unit &unit) const

and with specified units

Double getLong() const

Get the longitudinal angle (in radians)

Quantity getLong(const Unit &unit) const

and with specified units

Double getLat() const

Get the latitude angle (rad)

Quantity getLat(const Unit &unit) const

and with specified units

Quantity getLength() const

Generate the length

Quantity getLength(const Unit &unit) const

and generate it with the specified units

Double positionAngle(const MVPosition &other) const
Quantity positionAngle(const MVPosition &other, const Unit &unit) const

Get the position angle between the directions. I.e. the angle between the direction from one to the pole, and from one to the other.

Double separation(const MVPosition &other) const
Quantity separation(const MVPosition &other, const Unit &unit) const

Get the angular separation between two directions.

MVPosition crossProduct(const MVPosition &other) const

Produce the cross product

virtual void print(ostream &os) const

Print data

virtual MeasValue *clone() const

Clone

virtual Vector<Double> getVector() const

Get the value in internal units

virtual void putVector(const Vector<Double> &in)

Set the value from internal units (set 0 for empty vector)

virtual Vector<Quantum<Double> > getRecordValue() const
virtual Vector<Quantum<Double> > getXRecordValue() const
virtual Vector<Quantum<Double> > getTMRecordValue() const

Get the internal value as a Vector<Quantity>. Usable in records. The getXRecordValue() gets additional information for records. Note that the Vectors could be empty.

virtual Bool putValue(const Vector<Quantum<Double> > &in)

Set the internal value if correct values and dimensions

Double getLat(Double ln) const

Get the latitude assuming length is given