3 x 3 matrix
More...
#include <JMatrix3D.hh>
|
| JMatrix3D () |
| Default constructor. More...
|
|
| JMatrix3D (const double __a00, const double __a01, const double __a02, const double __a10, const double __a11, const double __a12, const double __a20, const double __a21, const double __a22) |
| Contructor. More...
|
|
JMatrix3D & | setIdentity () |
| Set to identity matrix. More...
|
|
void | set (const JMatrix3D &A) |
| Set matrix. More...
|
|
JMatrix3D & | reset () |
| Set matrix to the null matrix. More...
|
|
JMatrix3D & | transpose () |
| Transpose. More...
|
|
JMatrix3D & | negate () |
| Negate matrix. More...
|
|
JMatrix3D & | add (const JMatrix3D &A) |
| Matrix addition. More...
|
|
JMatrix3D & | sub (const JMatrix3D &A) |
| Matrix subtraction. More...
|
|
JMatrix3D & | mul (const double factor) |
| Scale matrix. More...
|
|
JMatrix3D & | div (const double factor) |
| Scale matrix. More...
|
|
JMatrix3D & | mul (const JMatrix3D &A, const JMatrix3D &B) |
| Matrix multiplication. More...
|
|
bool | equals (const JMatrix3D &A, const double eps=std::numeric_limits< double >::min()) const |
| Equality. More...
|
|
bool | isIdentity (const double eps=std::numeric_limits< double >::min()) const |
| Test identity. More...
|
|
double | getDeterminant () const |
| Get determinant of matrix. More...
|
|
void | transform (double &__x, double &__y, double &__z) const |
| Transform. More...
|
|
JMatrix3D & | mul (const JSecond_t &object) |
| Multiply with object. More...
|
|
3 x 3 matrix
Definition at line 32 of file JMath/JMatrix3D.hh.
◆ JMatrix3D() [1/2]
JMATH::JMatrix3D::JMatrix3D |
( |
| ) |
|
|
inline |
◆ JMatrix3D() [2/2]
JMATH::JMatrix3D::JMatrix3D |
( |
const double |
__a00, |
|
|
const double |
__a01, |
|
|
const double |
__a02, |
|
|
const double |
__a10, |
|
|
const double |
__a11, |
|
|
const double |
__a12, |
|
|
const double |
__a20, |
|
|
const double |
__a21, |
|
|
const double |
__a22 |
|
) |
| |
|
inline |
Contructor.
- Parameters
-
__a00 | (0,0) |
__a01 | (0,1) |
__a02 | (0,2) |
__a10 | (1,0) |
__a11 | (1,1) |
__a12 | (1,2) |
__a20 | (2,0) |
__a21 | (2,1) |
__a22 | (2,2) |
Definition at line 64 of file JMath/JMatrix3D.hh.
◆ getInstance()
static const JMatrix3D& JMATH::JMatrix3D::getInstance |
( |
| ) |
|
|
inlinestatic |
Get reference to unique instance of this class object.
- Returns
- zero matrix
Definition at line 78 of file JMath/JMatrix3D.hh.
◆ setIdentity()
◆ getIdentity()
static const JMatrix3D& JMATH::JMatrix3D::getIdentity |
( |
| ) |
|
|
inlinestatic |
Get reference to unique instance of this class object.
- Returns
- identity matrix
Definition at line 106 of file JMath/JMatrix3D.hh.
JMatrix3D()
Default constructor.
JMatrix3D & setIdentity()
Set to identity matrix.
◆ set()
void JMATH::JMatrix3D::set |
( |
const JMatrix3D & |
A | ) |
|
|
inline |
◆ reset()
◆ transpose()
◆ negate()
◆ add()
◆ sub()
◆ mul() [1/3]
JMatrix3D& JMATH::JMatrix3D::mul |
( |
const double |
factor | ) |
|
|
inline |
Scale matrix.
- Parameters
-
- Returns
- this matrix * factor
Definition at line 208 of file JMath/JMatrix3D.hh.
210 a00 *= factor;
a01 *= factor;
a02 *= factor;
211 a10 *= factor;
a11 *= factor;
a12 *= factor;
212 a20 *= factor;
a21 *= factor;
a22 *= factor;
◆ div()
JMatrix3D& JMATH::JMatrix3D::div |
( |
const double |
factor | ) |
|
|
inline |
Scale matrix.
- Parameters
-
- Returns
- this matrix / factor
Definition at line 224 of file JMath/JMatrix3D.hh.
226 a00 /= factor;
a01 /= factor;
a02 /= factor;
227 a10 /= factor;
a11 /= factor;
a12 /= factor;
228 a20 /= factor;
a21 /= factor;
a22 /= factor;
◆ mul() [2/3]
◆ equals()
bool JMATH::JMatrix3D::equals |
( |
const JMatrix3D & |
A, |
|
|
const double |
eps = std::numeric_limits<double>::min() |
|
) |
| const |
|
inline |
Equality.
- Parameters
-
A | matrix |
eps | numerical precision |
- Returns
- true if matrices identical; else false
Definition at line 267 of file JMath/JMatrix3D.hh.
270 return (fabs(
a00 - A.
a00) <= eps &&
271 fabs(
a01 - A.
a01) <= eps &&
272 fabs(
a02 - A.
a02) <= eps &&
273 fabs(
a10 - A.
a10) <= eps &&
274 fabs(
a11 - A.
a11) <= eps &&
275 fabs(
a12 - A.
a12) <= eps &&
276 fabs(
a20 - A.
a20) <= eps &&
277 fabs(
a21 - A.
a21) <= eps &&
278 fabs(
a22 - A.
a22) <= eps);
◆ isIdentity()
bool JMATH::JMatrix3D::isIdentity |
( |
const double |
eps = std::numeric_limits<double>::min() | ) |
const |
|
inline |
Test identity.
- Parameters
-
- Returns
- true if identity matrix; else false
Definition at line 288 of file JMath/JMatrix3D.hh.
static const JMatrix3D & getIdentity()
Get reference to unique instance of this class object.
bool equals(const JMatrix3D &A, const double eps=std::numeric_limits< double >::min()) const
Equality.
◆ getDeterminant()
double JMATH::JMatrix3D::getDeterminant |
( |
| ) |
const |
|
inline |
Get determinant of matrix.
- Returns
- determinant of matrix
Definition at line 299 of file JMath/JMatrix3D.hh.
◆ transform()
void JMATH::JMatrix3D::transform |
( |
double & |
__x, |
|
|
double & |
__y, |
|
|
double & |
__z |
|
) |
| const |
|
inline |
Transform.
- Parameters
-
__x | x value |
__y | y value |
__z | z value |
Definition at line 318 of file JMath/JMatrix3D.hh.
320 const double x =
a00 * __x +
a01 * __y +
a02 * __z;
321 const double y =
a10 * __x +
a11 * __y +
a12 * __z;
322 const double z =
a20 * __x +
a21 * __y +
a22 * __z;
◆ mul() [3/3]
Multiply with object.
- Parameters
-
- Returns
- result object
Definition at line 354 of file JMath.hh.
356 return static_cast<JFirst_t&
>(*this) = JFirst_t().mul(
static_cast<const JFirst_t&
>(*
this),
object);
◆ operator>>
Read matrix from input.
- Parameters
-
- Returns
- reader
Definition at line 337 of file JMath/JMatrix3D.hh.
339 in >> matrix.
a00; in >> matrix.
a01; in >> matrix.
a02;
340 in >> matrix.
a10; in >> matrix.
a11; in >> matrix.
a12;
341 in >> matrix.
a20; in >> matrix.
a21; in >> matrix.
a22;
◆ operator<< [1/2]
Write matrix to output.
- Parameters
-
- Returns
- writer
Definition at line 354 of file JMath/JMatrix3D.hh.
356 out << matrix.
a00; out << matrix.
a01; out << matrix.
a02;
357 out << matrix.
a10; out << matrix.
a11; out << matrix.
a12;
358 out << matrix.
a20; out << matrix.
a21; out << matrix.
a22;
◆ operator<< [2/2]
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const JMatrix3D & |
A |
|
) |
| |
|
friend |
Print ASCII formatted output.
- Parameters
-
- Returns
- output stream
Definition at line 371 of file JMath/JMatrix3D.hh.
375 const JFormat format(out, getFormat<JMatrix3D>(
JFormat_t(10, 3, std::ios::fixed | std::ios::showpos)));
377 out << format << A.
a00 <<
' ' << format << A.
a01 <<
' ' << format << A.
a02 << endl;
378 out << format << A.
a10 <<
' ' << format << A.
a11 <<
' ' << format << A.
a12 << endl;
379 out << format << A.
a20 <<
' ' << format << A.
a21 <<
' ' << format << A.
a22 << endl;
◆ a00
double JMATH::JMatrix3D::a00 |
◆ a01
double JMATH::JMatrix3D::a01 |
◆ a02
double JMATH::JMatrix3D::a02 |
◆ a10
double JMATH::JMatrix3D::a10 |
◆ a11
double JMATH::JMatrix3D::a11 |
◆ a12
double JMATH::JMatrix3D::a12 |
◆ a20
double JMATH::JMatrix3D::a20 |
◆ a21
double JMATH::JMatrix3D::a21 |
◆ a22
double JMATH::JMatrix3D::a22 |
The documentation for this class was generated from the following file: