casa
$Rev:20696$
|
Vector of three direction cosines. More...
#include <MVDirection.h>
Public Member Functions | |
MVDirection () | |
Default constructor generates a direction to the pole (i.e. | |
MVDirection (const MVPosition &other) | |
Copy constructor. | |
MVDirection (Double in0) | |
Constructs with elevation = 0. | |
MVDirection (const Quantity &angle0) | |
MVDirection (Double in0, Double in1, Double in2) | |
Creates a specified vector. | |
MVDirection (Double angle0, Double angle1) | |
Creates the direction cosines from specified angles along equator (azimuth) and towards pole (,elevation). | |
MVDirection (const Quantity &angle0, const Quantity &angle1) | |
Creates the direction cosines from specified angles. | |
MVDirection (const Quantum< Vector< Double > > &angle) | |
If not enough angles: pole (=(0,0,1)) assumed (if none), or elevation =0 (if 1); direction cosines assumed (if 3). | |
MVDirection (const Vector< Double > &other) | |
Create from Vector. | |
MVDirection (const Vector< Quantity > &other) | |
MVDirection & | operator= (const MVDirection &other) |
Copy assignment. | |
~MVDirection () | |
Destructor. | |
MVDirection & | operator+= (const MVDirection &right) |
Addition and subtraction. | |
MVDirection | operator+ (const MVDirection &right) const |
MVDirection & | operator-= (const MVDirection &right) |
MVDirection | operator- (const MVDirection &right) const |
virtual uInt | type () const |
Tell me your type. | |
virtual void | adjust () |
Adjust the direction cosines to a length of 1. | |
virtual void | adjust (Double &res) |
Adjust the direction cosines to a length of 1 and return the length value. | |
virtual MeasValue * | clone () const |
Re-adjust : taken from MVPosition. | |
Vector< Double > | get () const |
Generate a 2-vector of angles (in rad) | |
Double | getLat () const |
Get the latitude angle (rad) | |
Quantity | getLat (const Unit &unit) const |
and with specified units | |
Double | positionAngle (const MVPosition &other) const |
Get the position angle between the directions. | |
Double | positionAngle (const MVDirection &other) const |
Quantity | positionAngle (const MVPosition &other, const Unit &unit) const |
Quantity | positionAngle (const MVDirection &other, const Unit &unit) const |
Double | separation (const MVPosition &other) const |
Get the angular separation between two directions. | |
Double | separation (const MVDirection &other) const |
Quantity | separation (const MVPosition &other, const Unit &unit) const |
Quantity | separation (const MVDirection &other, const Unit &unit) const |
MVDirection | crossProduct (const MVDirection &other) const |
Produce the cross product. | |
virtual Vector< Quantum< Double > > | getRecordValue () const |
Get the internal value as a Vector<Quantity> . | |
virtual Vector< Quantum< Double > > | getXRecordValue () const |
virtual Vector< Quantum< Double > > | getTMRecordValue () const |
virtual Bool | putValue (const Vector< Quantum< Double > > &in) |
Set the internal value if correct values and dimensions. | |
void | setAngle (Double angle0, Double angle1) |
Set the internal value, using the longitude and latitude (in rad) given. | |
void | shift (const Quantum< Double > &lng, const Quantum< Double > &lat, Bool trueAngle=False) |
Shift the direction in longitude (radians if Double) and/or latitude. | |
void | shift (Double lng, Double lat, Bool trueAngle=False) |
void | shiftLongitude (const Quantity &lng, Bool trueAngle=False) |
void | shiftLongitude (Double lng, Bool trueAngle=False) |
void | shiftLatitude (const Quantum< Double > &lat, Bool trueAngle=False) |
void | shiftLatitude (Double lat, Bool trueAngle=False) |
void | shift (const MVDirection &shft, Bool trueAngle=False) |
void | shiftAngle (const Quantum< Double > &off, const Quantum< Double > &pa) |
Shift over an angle off in the direction pa. | |
void | shiftAngle (Double off, Double pa) |
Static Public Member Functions | |
static void | assure (const MeasValue &in) |
Vector of three direction cosines.
Public interface
<h3>Review Status</h3><dl><dt>Reviewed By:<dd>tcornwel<dt>Date Reviewed:<dd>1996/02/22<dt>Test programs:<dd>tMeasMath</dl>
From Measure, Value and Direction
An MVDirection is a 3-vector of direction cosines. It is based on the MVposition class. The main difference is that the length of the vector will be adjusted (normalised) to a length of 1 in all operations. It can be constructed with:
MVDirection(Quantum<Vector<Double> >)
creates an MVDirection from angle vector, assuming second as zero if not present, and pole if length 0. Assumes a direction cosine if 3 elements MVDirection(Vector<Double>)
creates an MVDirection with the same restrictions as previous one MVDirection(Vector<Quantum<Double> >)
creates an MVDirection with the same rstrictions as previous one; but with unit check. A void adjust() function normalises the vector to a length of 1; a get() returns as a Double 2-vector the angles of the direction cosines; a getAngle() returns a Quantum 2-vector, (uInt) returns the indicated element, and getValue returns the direction cosine vector.
Direction cosines can be added and subtracted: the result will be adjusted to a length of 1.
The multiplication of two direction cosines produces the inner product.
shift() methods are available to shift in angular coordinates. E.g. shift(Quantity(5, "arcsec"), Quantity(-7, "arcsec")) will shift 5 arcsec in longitude, and -7 arcsec in latitude. They have a trueAngle switch to shift in latitude and perpendicular (along a great circle) to it.
See MDirection
To aid coordinate transformations
Definition at line 106 of file MVDirection.h.
Default constructor generates a direction to the pole (i.e.
(0,0,1))
casa::MVDirection::MVDirection | ( | const MVPosition & | other | ) |
Copy constructor.
Constructs with elevation = 0.
casa::MVDirection::MVDirection | ( | const Quantity & | angle0 | ) |
casa::MVDirection::MVDirection | ( | Double | in0, |
Double | in1, | ||
Double | in2 | ||
) |
Creates a specified vector.
casa::MVDirection::MVDirection | ( | Double | angle0, |
Double | angle1 | ||
) |
Creates the direction cosines from specified angles along equator (azimuth) and towards pole (,elevation).
casa::MVDirection::MVDirection | ( | const Quantity & | angle0, |
const Quantity & | angle1 | ||
) |
Creates the direction cosines from specified angles.
casa::MVDirection::MVDirection | ( | const Quantum< Vector< Double > > & | angle | ) |
If not enough angles: pole (=(0,0,1)) assumed (if none), or elevation =0 (if 1); direction cosines assumed (if 3).
casa::MVDirection::MVDirection | ( | const Vector< Double > & | other | ) |
casa::MVDirection::MVDirection | ( | const Vector< Quantity > & | other | ) |
Destructor.
virtual void casa::MVDirection::adjust | ( | ) | [virtual] |
Adjust the direction cosines to a length of 1.
Reimplemented from casa::MVPosition.
virtual void casa::MVDirection::adjust | ( | Double & | res | ) | [virtual] |
Adjust the direction cosines to a length of 1 and return the length value.
Reimplemented from casa::MVPosition.
static void casa::MVDirection::assure | ( | const MeasValue & | in | ) | [static] |
Reimplemented from casa::MVPosition.
virtual MeasValue* casa::MVDirection::clone | ( | ) | const [virtual] |
MVDirection casa::MVDirection::crossProduct | ( | const MVDirection & | other | ) | const |
Produce the cross product.
Vector<Double> casa::MVDirection::get | ( | ) | const |
Generate a 2-vector of angles (in rad)
Reimplemented from casa::MVPosition.
Double casa::MVDirection::getLat | ( | ) | const |
Get the latitude angle (rad)
Reimplemented from casa::MVPosition.
Quantity casa::MVDirection::getLat | ( | const Unit & | unit | ) | const |
and with specified units
Reimplemented from casa::MVPosition.
virtual Vector<Quantum<Double> > casa::MVDirection::getRecordValue | ( | ) | const [virtual] |
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.
Reimplemented from casa::MVPosition.
virtual Vector<Quantum<Double> > casa::MVDirection::getTMRecordValue | ( | ) | const [virtual] |
Reimplemented from casa::MVPosition.
virtual Vector<Quantum<Double> > casa::MVDirection::getXRecordValue | ( | ) | const [virtual] |
Reimplemented from casa::MVPosition.
MVDirection casa::MVDirection::operator+ | ( | const MVDirection & | right | ) | const |
MVDirection& casa::MVDirection::operator+= | ( | const MVDirection & | right | ) |
Addition and subtraction.
MVDirection casa::MVDirection::operator- | ( | const MVDirection & | right | ) | const |
MVDirection& casa::MVDirection::operator-= | ( | const MVDirection & | right | ) |
MVDirection& casa::MVDirection::operator= | ( | const MVDirection & | other | ) |
Copy assignment.
Double casa::MVDirection::positionAngle | ( | const MVPosition & | other | ) | 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.
Reimplemented from casa::MVPosition.
Double casa::MVDirection::positionAngle | ( | const MVDirection & | other | ) | const |
Quantity casa::MVDirection::positionAngle | ( | const MVPosition & | other, |
const Unit & | unit | ||
) | const |
Reimplemented from casa::MVPosition.
Quantity casa::MVDirection::positionAngle | ( | const MVDirection & | other, |
const Unit & | unit | ||
) | const |
virtual Bool casa::MVDirection::putValue | ( | const Vector< Quantum< Double > > & | in | ) | [virtual] |
Set the internal value if correct values and dimensions.
Reimplemented from casa::MVPosition.
Double casa::MVDirection::separation | ( | const MVPosition & | other | ) | const |
Get the angular separation between two directions.
Reimplemented from casa::MVPosition.
Double casa::MVDirection::separation | ( | const MVDirection & | other | ) | const |
Quantity casa::MVDirection::separation | ( | const MVPosition & | other, |
const Unit & | unit | ||
) | const |
Reimplemented from casa::MVPosition.
Quantity casa::MVDirection::separation | ( | const MVDirection & | other, |
const Unit & | unit | ||
) | const |
void casa::MVDirection::setAngle | ( | Double | angle0, |
Double | angle1 | ||
) |
Set the internal value, using the longitude and latitude (in rad) given.
void casa::MVDirection::shift | ( | const Quantum< Double > & | lng, |
const Quantum< Double > & | lat, | ||
Bool | trueAngle = False |
||
) |
Shift the direction in longitude (radians if Double) and/or latitude.
If the trueAngle switch is True, the longitude shift will be in angular units perpendicular to the direction to the pole at the shifted latitude, along a great circle.
void casa::MVDirection::shift | ( | Double | lng, |
Double | lat, | ||
Bool | trueAngle = False |
||
) |
void casa::MVDirection::shift | ( | const MVDirection & | shft, |
Bool | trueAngle = False |
||
) |
void casa::MVDirection::shiftAngle | ( | const Quantum< Double > & | off, |
const Quantum< Double > & | pa | ||
) |
Shift over an angle off in the direction pa.
pa is measured from North, in the direction of increasing longitude.
void casa::MVDirection::shiftAngle | ( | Double | off, |
Double | pa | ||
) |
void casa::MVDirection::shiftLatitude | ( | const Quantum< Double > & | lat, |
Bool | trueAngle = False |
||
) |
void casa::MVDirection::shiftLatitude | ( | Double | lat, |
Bool | trueAngle = False |
||
) |
void casa::MVDirection::shiftLongitude | ( | const Quantity & | lng, |
Bool | trueAngle = False |
||
) |
void casa::MVDirection::shiftLongitude | ( | Double | lng, |
Bool | trueAngle = False |
||
) |
virtual uInt casa::MVDirection::type | ( | ) | const [virtual] |
Tell me your type.
Reimplemented from casa::MVPosition.