2x2 Matrices in floating point

Data Structures | Typedefs | Functions
2x2 Matrices in floating point
Eina » Data Types » Matrix

Definition and operations for 2x3 matrices. More...

## Data Structures
struct | _Eina_Matrix2
struct | Eina_Matrix2
| A 2x2 floating point matrix. More...

## Typedefs
typedef struct _Eina_Matrix2 | Eina_Matrix2
| A 2x2 floating point matrix.

## Functions
EINA_API void | eina_matrix2_values_set (Eina_Matrix2 *m, double xx, double xy, double yx, double yy)
| Sets the values of the coefficients of the given floating point matrix. More...
EINA_API void | eina_matrix2_values_get (const Eina_Matrix2 *m, double *xx, double *xy, double *yx, double *yy)
| Gets the values of the coefficients of the given floating point matrix. More...
EINA_API void | eina_matrix2_inverse (Eina_Matrix2 *out, const Eina_Matrix2 *mat)
| Computes the inverse with check of the given matrix. More...
EINA_API void | eina_matrix2_identity (Eina_Matrix2 *m)
| Sets the given floating point matrix to the identity matrix. More...
EINA_API void | eina_matrix2_array_set (Eina_Matrix2 *m, const double *v)
| Sets array to matrix. More...
EINA_API void | eina_matrix2_copy (Eina_Matrix2 *dst, const Eina_Matrix2 *src)
| Copies matrix. More...
EINA_API void | eina_matrix2_multiply (Eina_Matrix2 *out, const Eina_Matrix2 *mat_a, const Eina_Matrix2 *mat_b)
| Multiplies two matrices. More...
EINA_API void | eina_matrix2_multiply_copy (Eina_Matrix2 *out, const Eina_Matrix2 *mat_a, const Eina_Matrix2 *mat_b)
| Multiplies two matrices with check. More...
EINA_API Eina_Matrix_Type | eina_matrix2_type_get (const Eina_Matrix2 *m)
| Returns the type of the given floating point matrix. More...

## Detailed Description

Definition and operations for 2x3 matrices.

## Function Documentation

## ◆ eina_matrix2_values_set()

EINA_API void eina_matrix2_values_set | ( | Eina_Matrix2 * | m,
|  | double | xx,
|  | double | xy,
|  | double | yx,
|  | double | yy
| ) |  |

Sets the values of the coefficients of the given floating point matrix.

Parameters

  [out] | m | The floating point matrix.
  [in] | xx | The first coefficient value.
  [in] | xy | The second coefficient value.
  [in] | yx | The fourth coefficient value.
  [in] | yy | The fifth coefficient value.

This function sets the values of the coefficients of the matrix `m`. No check is done on `m`.

See also
  eina_matrix2_values_get()

Since
  1.17

## ◆ eina_matrix2_values_get()

EINA_API void eina_matrix2_values_get | ( | const Eina_Matrix2 * | m,
|  | double * | xx,
|  | double * | xy,
|  | double * | yx,
|  | double * | yy
| ) |  |

Gets the values of the coefficients of the given floating point matrix.

Parameters

  [out] | m | The floating point matrix.
  [in] | xx | The first coefficient value.
  [in] | xy | The second coefficient value.
  [in] | yx | The fourth coefficient value.
  [in] | yy | The fifth coefficient value.

This function gets the values of the coefficients of the matrix `m`. No check is done on `m`.

See also
  eina_matrix2_values_set()

Since
  1.17

## ◆ eina_matrix2_inverse()

EINA_API void eina_matrix2_inverse | ( | Eina_Matrix2 * | out,
|  | const Eina_Matrix2 * | mat
| ) |  |

Computes the inverse with check of the given matrix.

Parameters

  [out] | out | The matrix to inverse.
  [in] | mat | The inverse matrix.

This function inverse the matrix `out` and stores the result in `mat`. No check is done on `out` or `mat`. If `out` can not be invertible, then `mat` is set to the identity matrix.

Since
  1.17

References EINA_DBL_EQ, eina_matrix2_copy(), eina_matrix2_type_get(), and EINA_MATRIX_TYPE_IDENTITY.

## ◆ eina_matrix2_identity()

EINA_API void eina_matrix2_identity | ( | Eina_Matrix2 * | m | ) |

Sets the given floating point matrix to the identity matrix.

Parameters

  [out] | m | The floating point matrix to set.

This function sets `m` to the identity matrix. No check is done on `m`.

Since
  1.17

## ◆ eina_matrix2_array_set()

EINA_API void eina_matrix2_array_set | ( | Eina_Matrix2 * | m,
|  | const double * | v
| ) |  |

Sets array to matrix.

Parameters

  [out] | m | The result matrix.
  [in] | v | The the array[4] for set.

Set to matrix first 4 elements from array

Since
  1.17

## ◆ eina_matrix2_copy()

EINA_API void eina_matrix2_copy | ( | Eina_Matrix2 * | dst,
|  | const Eina_Matrix2 * | src
| ) |  |

Copies matrix.

Parameters

  [out] | dst | The matrix copy.
  [in] | src | The matrix to copy.

Since
  1.17

Referenced by eina_matrix2_inverse(), eina_matrix2_multiply(), and eina_matrix2_multiply_copy().

## ◆ eina_matrix2_multiply()

EINA_API void eina_matrix2_multiply | ( | Eina_Matrix2 * | out,
|  | const Eina_Matrix2 * | mat_a,
|  | const Eina_Matrix2 * | mat_b
| ) |  |

Multiplies two matrices.

Parameters

  [out] | out | The resulting matrix.
  [in] | mat_a | The first member of the multiplication.
  [in] | mat_b | The second member of the multiplication.

Since
  1.17

References eina_matrix2_copy(), eina_matrix2_type_get(), and EINA_MATRIX_TYPE_IDENTITY.

Referenced by eina_matrix2_multiply_copy().

## ◆ eina_matrix2_multiply_copy()

EINA_API void eina_matrix2_multiply_copy | ( | Eina_Matrix2 * | out,
|  | const Eina_Matrix2 * | mat_a,
|  | const Eina_Matrix2 * | mat_b
| ) |  |

Multiplies two matrices with check.

Parameters

  [out] | out | The resulting matrix.
  [in] | mat_a | The first member of the multiplication.
  [in] | mat_b | The second member of the multiplication.

Since
  1.17

References eina_matrix2_copy(), and eina_matrix2_multiply().

## ◆ eina_matrix2_type_get()

EINA_API Eina_Matrix_Type eina_matrix2_type_get | ( | const Eina_Matrix2 * | m | ) |

Returns the type of the given floating point matrix.

Parameters

  [in] | m | The floating point matrix.

Returns
  The type of the matrix.

This function returns the type of the matrix `m`. No check is done on `m`.

Since
  1.17

References EINA_DBL_EQ, EINA_MATRIX_TYPE_AFFINE, and EINA_MATRIX_TYPE_IDENTITY.

Referenced by eina_matrix2_inverse(), and eina_matrix2_multiply().