|
Rhino C++ API
9.0
|
#include <opennurbs_matrix.h>
Public Member Functions | |
| ON_2x2Matrix ()=default | |
| ON_2x2Matrix (const class ON_Matrix &M) | |
| ON_2x2Matrix (const double M[2][2]) | |
| ON_2x2Matrix (const ON_2x2Matrix &)=default | |
| ON_2x2Matrix (double a, double b, double c, double d) | |
| ON_2x2Matrix (double d) | |
| ON_2x2Matrix (double d0, double d1) | |
| ON_2x2Matrix (double M[2][2]) | |
| ~ON_2x2Matrix ()=default | |
| double | Coefficient (int i, int j) const |
| double | Determinant () const |
| const ON_2x2Matrix | Inverse () const |
| bool | IsDiagonal () const |
| bool | IsDiagonal (double relative_tolerance) const |
| bool | IsIdentity () const |
| bool | IsIdentity (double tolerance) const |
| bool | IsNotZero () const |
| bool | IsNotZero (double zero_tolerance) const |
| bool | IsOrthoganal () const |
| bool | IsOrthoganal (double tolerance) const |
| M is an orthoganal matrix if M * Transpose(M) = Identity. More... | |
| bool | IsValid () const |
| bool | IsZero () const |
| bool | IsZero (double zero_tolerance) const |
| double | MaximumCoefficientAbsoluteValue () const |
| double | MaximumDigonalAbsoluteValue () const |
| double | MaximumOffDigonalAbsoluteValue () const |
| double | MinimumCoefficientAbsoluteValue () const |
| double | MinimumDigonalAbsoluteValue () const |
| double | MinimumOffDigonalAbsoluteValue () const |
| ON_2x2Matrix & | operator= (const ON_2x2Matrix &)=default |
| double * | operator[] (int i) |
| const double * | operator[] (int i) const |
| const ON_2x2Matrix | PseudoInverse () const |
| Use the singular value decomposition to get the pseudo inverse. More... | |
| int | Rank () const |
| int | Rank (double zero_tolerance) const |
| bool | SVD (ON_2x2Matrix &U, double singular_values[2], ON_2x2Matrix &V) const |
| Get the singular vaue decomposition of this matrix = U * Diagonal(singular_values[0], singular_values[1]) * Transpose(V). More... | |
| const ON_2x2Matrix | SwapColumns () const |
| const ON_2x2Matrix | SwapRows () const |
| const ON_2x2Matrix | SwapRowsAndColumns () const |
| double | Trace () const |
| const ON_2x2Matrix | Transpose () const |
Static Public Member Functions | |
| static const ON_2x2Matrix | CombineSVD (const ON_2x2Matrix &U, double s0, double s1, const ON_2x2Matrix &V) |
| static const ON_2x2Matrix | ProcrustesRotation (const ON_2dPoint &P0, const ON_2dPoint &P1, const ON_2dPoint &P2, const ON_2dPoint &Q0, const ON_2dPoint &Q1, const ON_2dPoint &Q2) |
| Use theKabsch-Umeyama algorithm to calculate the rotation matrix R that minimizes |R*P0 - Q0|^2 + |R*P1 - Q1|^2 + |R*P2 - Q2|^2. The input must satisfy P0 + P1 + P2 = (0,0) and Q0 + Q1 + Q2 = (0,0). Typically, by the time you are calculating this rotation, the P and Q triangles have the same orientation. If you want a rotation matrix that acts on the right, take the transpose of the returned value. If you have more than 3 points, use the version of ProcrustesRotation() that takes a 2x2 matrix H = P * Transpose(Q). More... | |
| static const ON_2x2Matrix | ProcrustesRotation (const ON_2x2Matrix &H) |
| If P[] and Q[] are sets of N 2d points, N gt;= 3, P[0] + ... + P[N-1] = (0,0) and Q[0] + ... + Q[N-1] = (0,0), then the Procrustes left rotation R is the rotation matrix that minimizes |R*P[0] - Q[0]|^2 + ... + |R*P[N-1] - Q[N-1]|^2. More... | |
| static const ON_2x2Matrix | Rotation (double cos_angle, double sin_angle) |
| Get a rotation matrix that acts on the left (rotated point = R * point). If you want a rotation matrix that acts on the right, then use the transpose of the returned matrix. More... | |
| static const ON_2x2Matrix | Rotation (ON_2dVector V) |
| Get a rotation matrix that acts on the left (rotated point = R * point). If you want a rotation matrix that acts on the right, then use the transpose of the returned matrix. More... | |
| static const ON_2x2Matrix | RotationDegrees (double angle_degrees) |
| Get a rotation matrix that acts on the left (rotated point = R * point). If you want a rotation matrix that acts on the right, then use the transpose of the returned matrix. More... | |
| static const ON_2x2Matrix | RotationRadians (double angle_radians) |
| Get a rotation matrix that acts on the left (rotated point = R * point). If you want a rotation matrix that acts on the right, then use the transpose of the returned matrix. More... | |
| static bool | Test (ON_TextLog &text_log) |
| Test a ON_2x2Matrix::SVD(), ON_2x2Matrix::Determinant(), ON_2x2Matrix::Rank() and ON_2x2Matrix::Inverse() on every matrix returned by the version of TestList() with a callback parameter More... | |
| static unsigned | TestList (ON__UINT_PTR context, bool(*Callback)(ON__UINT_PTR context, int A_rank, const ON_2x2Matrix A)) |
| Iterates through a sequence of test matrices. More... | |
Public Attributes | |
| double | m [2][2] |
Static Public Attributes | |
| static const ON_2x2Matrix | Identity |
| The diagonal coefficients are 1 and the off diagonal coefficients are 0. More... | |
| static const ON_2x2Matrix | Nan |
| Every coefficient is ON_DBL_QNAN. More... | |
| static const ON_2x2Matrix | Zero |
| All coefficients are 0. More... | |
| static const double | ZeroTolerance |
| Default zero tolerance that can be used when a nonzero tolerance is needed and you don't know what to pass. 1.0e-12. More... | |
|
default |
|
default |
|
default |
| ON_2x2Matrix::ON_2x2Matrix | ( | double | M[2][2] | ) |
| ON_2x2Matrix::ON_2x2Matrix | ( | const double | M[2][2] | ) |
| ON_2x2Matrix::ON_2x2Matrix | ( | double | d | ) |
| ON_2x2Matrix::ON_2x2Matrix | ( | double | d0, |
| double | d1 | ||
| ) |
| ON_2x2Matrix::ON_2x2Matrix | ( | double | a, |
| double | b, | ||
| double | c, | ||
| double | d | ||
| ) |
| ON_2x2Matrix::ON_2x2Matrix | ( | const class ON_Matrix & | M | ) |
| double ON_2x2Matrix::Coefficient | ( | int | i, |
| int | j | ||
| ) | const |
|
static |
| double ON_2x2Matrix::Determinant | ( | ) | const |
| const ON_2x2Matrix ON_2x2Matrix::Inverse | ( | ) | const |
| bool ON_2x2Matrix::IsDiagonal | ( | ) | const |
| bool ON_2x2Matrix::IsDiagonal | ( | double | relative_tolerance | ) | const |
| bool ON_2x2Matrix::IsIdentity | ( | ) | const |
| bool ON_2x2Matrix::IsIdentity | ( | double | tolerance | ) | const |
| tolerance |
| bool ON_2x2Matrix::IsNotZero | ( | ) | const |
| zero_tolerance |
| bool ON_2x2Matrix::IsNotZero | ( | double | zero_tolerance | ) | const |
| zero_tolerance |
| bool ON_2x2Matrix::IsOrthoganal | ( | ) | const |
| bool ON_2x2Matrix::IsOrthoganal | ( | double | tolerance | ) | const |
M is an orthoganal matrix if M * Transpose(M) = Identity.
| tolerance | If every coefficient of (M * Transpose(M) - Idenity) has absolute value <= tolerance, then true is returned. |
| bool ON_2x2Matrix::IsValid | ( | ) | const |
| bool ON_2x2Matrix::IsZero | ( | ) | const |
| bool ON_2x2Matrix::IsZero | ( | double | zero_tolerance | ) | const |
| zero_tolerance |
| double ON_2x2Matrix::MaximumCoefficientAbsoluteValue | ( | ) | const |
| double ON_2x2Matrix::MaximumDigonalAbsoluteValue | ( | ) | const |
| double ON_2x2Matrix::MaximumOffDigonalAbsoluteValue | ( | ) | const |
| double ON_2x2Matrix::MinimumCoefficientAbsoluteValue | ( | ) | const |
| double ON_2x2Matrix::MinimumDigonalAbsoluteValue | ( | ) | const |
| double ON_2x2Matrix::MinimumOffDigonalAbsoluteValue | ( | ) | const |
|
default |
| double* ON_2x2Matrix::operator[] | ( | int | i | ) |
| i | 0 <= i < 1 |
| const double* ON_2x2Matrix::operator[] | ( | int | i | ) | const |
| i | 0 <= i < 1 |
|
static |
Use theKabsch-Umeyama algorithm to calculate the rotation matrix R that minimizes |R*P0 - Q0|^2 + |R*P1 - Q1|^2 + |R*P2 - Q2|^2.
The input must satisfy P0 + P1 + P2 = (0,0) and Q0 + Q1 + Q2 = (0,0). Typically, by the time you are calculating this rotation, the P and Q triangles have the same orientation. If you want a rotation matrix that acts on the right, take the transpose of the returned value. If you have more than 3 points, use the version of ProcrustesRotation() that takes a 2x2 matrix H = P * Transpose(Q).
| P0 | |
| P1 | |
| P2 | |
| Q0 | |
| Q1 | |
| Q2 |
|
static |
If P[] and Q[] are sets of N 2d points, N gt;= 3, P[0] + ... + P[N-1] = (0,0) and Q[0] + ... + Q[N-1] = (0,0), then the Procrustes left rotation R is the rotation matrix that minimizes |R*P[0] - Q[0]|^2 + ... + |R*P[N-1] - Q[N-1]|^2.
| H | H = P * Transpose(Q), where P is the 2xN matrix whose columns are P[0], ..., P[N-1] and Q is the 2xN matrix whose columns are Q[0], ..., Q[N-1]. |
| const ON_2x2Matrix ON_2x2Matrix::PseudoInverse | ( | ) | const |
Use the singular value decomposition to get the pseudo inverse.
| int ON_2x2Matrix::Rank | ( | ) | const |
| int ON_2x2Matrix::Rank | ( | double | zero_tolerance | ) | const |
| zero_tolerance | Coefficients and determinants with absolute value <= zero_tolerance are treated as 0. /// |
|
static |
Get a rotation matrix that acts on the left (rotated point = R * point). If you want a rotation matrix that acts on the right, then use the transpose of the returned matrix.
| cos_angle | |
| sin_angle |
|
static |
Get a rotation matrix that acts on the left (rotated point = R * point). If you want a rotation matrix that acts on the right, then use the transpose of the returned matrix.
| V |
|
static |
Get a rotation matrix that acts on the left (rotated point = R * point). If you want a rotation matrix that acts on the right, then use the transpose of the returned matrix.
| angle_degrees |
|
static |
Get a rotation matrix that acts on the left (rotated point = R * point). If you want a rotation matrix that acts on the right, then use the transpose of the returned matrix.
| angle_radians |
| bool ON_2x2Matrix::SVD | ( | ON_2x2Matrix & | U, |
| double | singular_values[2], | ||
| ON_2x2Matrix & | V | ||
| ) | const |
Get the singular vaue decomposition of this matrix = U * Diagonal(singular_values[0], singular_values[1]) * Transpose(V).
| U | The returned U will be an orthoganal matrix. |
| singular_values | The singular values are returned in increasing order 0 <= singular_values[0] <= singular_values[1]. |
| V | The returned V will be an orthoganal matrix. |
| const ON_2x2Matrix ON_2x2Matrix::SwapColumns | ( | ) | const |
| const ON_2x2Matrix ON_2x2Matrix::SwapRows | ( | ) | const |
| const ON_2x2Matrix ON_2x2Matrix::SwapRowsAndColumns | ( | ) | const |
|
static |
Test a ON_2x2Matrix::SVD(), ON_2x2Matrix::Determinant(), ON_2x2Matrix::Rank() and ON_2x2Matrix::Inverse() on every matrix returned by the version of TestList() with a callback parameter
| text_log | A description of any failure and the number of successful tests is sent to text_log. |
|
static |
Iterates through a sequence of test matrices.
| context | Value passed as the first parameter to Callback() |
| Callback | This function is called for each test matrix. A is the matrix being tested. If the A_rank paratmer is >=0, then A was computed in a way that if arithmetic was perfect, then A.rank() would be A_rank. Otherwise A_rank = -1 and the rank of A is unknown. Return true to continue testing |
| double ON_2x2Matrix::Trace | ( | ) | const |
| const ON_2x2Matrix ON_2x2Matrix::Transpose | ( | ) | const |
|
static |
The diagonal coefficients are 1 and the off diagonal coefficients are 0.
| double ON_2x2Matrix::m[2][2] |
|
static |
Every coefficient is ON_DBL_QNAN.
|
static |
All coefficients are 0.
|
static |
Default zero tolerance that can be used when a nonzero tolerance is needed and you don't know what to pass. 1.0e-12.
1.8.17