casacore
Loading...
Searching...
No Matches
RotMatrix.h
Go to the documentation of this file.
1//# RotMatrix.h: a 3x3 rotation matrix
2//# Copyright (C) 1995,1996,1997,1999,2000,2001
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: casa-feedback@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25
26#ifndef CASA_ROTMATRIX_H
27#define CASA_ROTMATRIX_H
28
29
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Arrays/Matrix.h>
33#include <casacore/casa/Arrays/Vector.h>
34#include <casacore/casa/iosfwd.h>
35
36namespace casacore { //# NAMESPACE CASACORE - BEGIN
37
38//# Forward Declarations
39class Euler;
40
41//# Constants (SUN compiler does not accept non-simple default arguments)
42
43// <summary>
44// A 3x3 rotation matrix
45// </summary>
46
47// <use visibility=local>
48
49// <reviewed reviewer="tcornwel" date="1996/02/15" tests="tMeasMath" demos="">
50// </reviewed>
51
52// <prerequisite>
53// <li> <linkto class=Matrix>Matrix</linkto>
54// <li> <linkto class=Euler>Euler</linkto>
55// </prerequisite>
56//
57// <etymology>
58// From Rotation and Matrix
59// </etymology>
60//
61// <synopsis>
62// A rotation matrix is a 3x3 matrix, which can be used to rotate a coordinate
63// system, notably the direction cosines in
64// <linkto class=MVDirection>MVDirection</linkto>.<br>
65// A RotMatrix can be constructed by the default constructor (which will
66// set the diagonal to 1), a copy constructor, and from a set of
67// Euler angles with <src>RotMatrix(Euler)</src>.<br>
68// Multiplication can be done (by *= and *) of two rotation matrices.<br>
69// The (uInt, uInt) operator returns the indicated element.
70// </synopsis>
71//
72// <example>
73// See <linkto class=Euler>Euler</linkto>
74// </example>
75//
76// <motivation>
77// To use in nutation and other coordinate calculations
78// </motivation>
79//
80// <todo asof="1996/02/15">
81// </todo>
82
84{
85 public:
86//# Friends
87// Output a rotation matrix as a matrix
88 friend ostream &operator<< (ostream &os, const RotMatrix &rot);
89//# Constructors
90// Default constructor generates a unit 3x3 matrix.
92// The copy constructor copies
93 RotMatrix(const RotMatrix &other);
94// Make from an Euler
95 RotMatrix(const Euler &other);
96// Make from an Euler around specified axes
97 RotMatrix(const Euler &other, Int ax0, Int ax1, Int ax2);
98// Copy assignment
100
101// Destructor
103
104//# Operators
105// The multiplication operations generate matrix products
106// <group>
108 RotMatrix operator*(const RotMatrix &other) const;
109// </group>
110
111// Return the indicated element
112// <group>
113 Double &operator()(uInt row, uInt column);
114 const Double &operator()(uInt row, uInt column) const;
115// </group>
116
117 //# Methods
118// Get as Matrix
120
121// Transpose the rotation matrix
122 void transpose();
123
124// Fill Rotation matrix from Matrix
125 void set(const Matrix<Double> &in);
126
127// Fill Rotation matrix from 3 (row) vectors
128 void set(const Vector<Double> &in0, const Vector<Double> &in1,
129 const Vector<Double> &in2);
130
131 private:
132//# Data
133// The rotation matrix (3x3)
135
136//# Member functions
137// Apply to a rotation matrix a further rotation of angle around the specified
138// axis which (0 or 1 or 2).
139 void applySingle(Double angle, Int which);
140};
141
142
143} //# NAMESPACE CASACORE - END
144
145#endif
void applySingle(Double angle, Int which)
Apply to a rotation matrix a further rotation of angle around the specified axis which (0 or 1 or 2).
RotMatrix()
Default constructor generates a unit 3x3 matrix.
void transpose()
Transpose the rotation matrix.
friend ostream & operator<<(ostream &os, const RotMatrix &rot)
Output a rotation matrix as a matrix.
void set(const Vector< Double > &in0, const Vector< Double > &in1, const Vector< Double > &in2)
Fill Rotation matrix from 3 (row) vectors.
Matrix< Double > get() const
Get as Matrix.
const Double & operator()(uInt row, uInt column) const
RotMatrix & operator*=(const RotMatrix &other)
The multiplication operations generate matrix products.
Double & operator()(uInt row, uInt column)
Return the indicated element.
Double rotat[3][3]
The rotation matrix (3x3)
Definition RotMatrix.h:134
void set(const Matrix< Double > &in)
Fill Rotation matrix from Matrix.
RotMatrix(const Euler &other)
Make from an Euler.
~RotMatrix()
Destructor.
RotMatrix(const Euler &other, Int ax0, Int ax1, Int ax2)
Make from an Euler around specified axes.
RotMatrix & operator=(const RotMatrix &other)
Copy assignment.
RotMatrix operator*(const RotMatrix &other) const
RotMatrix(const RotMatrix &other)
The copy constructor copies.
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
int Int
Definition aipstype.h:48
double Double
Definition aipstype.h:53