Matrices in floating point

Data Structures | Typedefs | Functions
Matrices in floating point

Matrix definition and operations. More...

## Data Structures
struct | _Eina_Matrix2

## Typedefs
typedef struct _Eina_Matrix2 | Eina_Matrix2

## Functions
EAPI Eina_Matrix_Type | eina_matrix4_type_get (const Eina_Matrix4 *m)
| Return the type of the given floating point matrix. More...
EAPI void | eina_matrix4_values_set (Eina_Matrix4 *m, double xx, double xy, double xz, double xw, double yx, double yy, double yz, double yw, double zx, double zy, double zz, double zw, double wx, double wy, double wz, double ww)
| Set the values of the coefficients of the given floating point matrix. More...
EAPI void | eina_matrix4_values_get (const Eina_Matrix4 *m, double *xx, double *xy, double *xz, double *xw, double *yx, double *yy, double *yz, double *yw, double *zx, double *zy, double *zz, double *zw, double *wx, double *wy, double *wz, double *ww)
| Get the values of the coefficients of the given floating point matrix. More...
EAPI double | eina_matrix4_determinant (const Eina_Matrix4 *m)
| Return the determinant of the given matrix. More...
EAPI Eina_Bool | eina_matrix4_normalized (Eina_Matrix4 *out, const Eina_Matrix4 *in)
| Return the determinant of the given matrix. More...
EAPI Eina_Bool | eina_matrix4_inverse (Eina_Matrix4 *out, const Eina_Matrix4 *in)
| Return the inverse of the given matrix. More...
EAPI void | eina_matrix4_transpose (Eina_Matrix4 *out, const Eina_Matrix4 *in)
| Return the transpose of the given matrix. More...
EAPI void | eina_matrix4_matrix3_to (Eina_Matrix3 *m3, const Eina_Matrix4 *m4)
| Convert an Eina_Matrix4 into an Eina_Matrix3. More...
EAPI void | eina_matrix3_matrix4_to (Eina_Matrix4 *m4, const Eina_Matrix3 *m3)
| Convert an Eina_Matrix3 into an Eina_Matrix4. More...
EAPI void | eina_matrix4_identity (Eina_Matrix4 *out)
| Set an identity matrix. More...
EAPI void | eina_matrix4_multiply_copy (Eina_Matrix4 *out, const Eina_Matrix4 *mat_a, const Eina_Matrix4 *mat_b)
| Multiply two matrix. More...
EAPI void | eina_matrix4_array_set (Eina_Matrix4 *m, const double *v)
| Set array to matrix. More...
EAPI void | eina_matrix4_copy (Eina_Matrix4 *dst, const Eina_Matrix4 *src)
| Copy matrix. More...
EAPI void | eina_matrix4_multiply (Eina_Matrix4 *out, const Eina_Matrix4 *mat_a, const Eina_Matrix4 *mat_b)
| Multiply two matrix with check. More...
EAPI void | eina_matrix4_ortho_set (Eina_Matrix4 *m, double left, double right, double bottom, double top, double dnear, double dfar)
| Set orthogonality matrix. More...
EAPI void | eina_matrix3_array_set (Eina_Matrix3 *m, const double *v)
| Set array to matrix. More...
EAPI void | eina_matrix3_copy (Eina_Matrix3 *dst, const Eina_Matrix3 *src)
| Copy matrix. More...
EAPI void | eina_matrix3_multiply (Eina_Matrix3 *out, const Eina_Matrix3 *mat_a, const Eina_Matrix3 *mat_b)
EAPI void | eina_matrix3_multiply_copy (Eina_Matrix3 *out, const Eina_Matrix3 *mat_a, const Eina_Matrix3 *mat_b)
| Multiply two matrix. More...
EAPI void | eina_matrix3_scale_transform_set (Eina_Matrix3 *out, double s_x, double s_y)
| Transform scale of matrix. More...
EAPI void | eina_matrix3_position_transform_set (Eina_Matrix3 *out, const double p_x, const double p_y)
| Transform position of matrix. More...
EAPI void | eina_normal3_matrix_get (Eina_Matrix3 *out, const Eina_Matrix4 *m)
| Set normal of the given matrix. More...
EAPI void | eina_matrix2_values_set (Eina_Matrix2 *m, double xx, double xy, double yx, double yy)
| Set the values of the coefficients of the given floating point matrix. More...
EAPI void | eina_matrix2_values_get (const Eina_Matrix2 *m, double *xx, double *xy, double *yx, double *yy)
| Get the values of the coefficients of the given floating point matrix. More...
EAPI void | eina_matrix2_inverse (Eina_Matrix2 *out, const Eina_Matrix2 *mat)
| Compute the inverse with check of the given matrix. More...
EAPI void | eina_matrix2_identity (Eina_Matrix2 *m)
| Set the given floating point matrix to the identity matrix. More...
EAPI void | eina_matrix2_array_set (Eina_Matrix2 *m, const double *v)
| Set array to matrix. More...
EAPI void | eina_matrix2_copy (Eina_Matrix2 *dst, const Eina_Matrix2 *src)
| Copy matrix. More...
EAPI void | eina_matrix2_multiply (Eina_Matrix2 *out, const Eina_Matrix2 *mat_a, const Eina_Matrix2 *mat_b)
| Multiply two matrix. More...
EAPI void | eina_matrix2_multiply_copy (Eina_Matrix2 *out, const Eina_Matrix2 *mat_a, const Eina_Matrix2 *mat_b)
| Multiply two matrix with check. More...
EAPI Eina_Matrix_Type | eina_matrix2_type_get (const Eina_Matrix2 *m)
| Return the type of the given floating point matrix. More...

## Detailed Description

Matrix definition and operations.

## Function Documentation

## ◆ eina_matrix4_type_get()

EAPI Eina_Matrix_Type eina_matrix4_type_get | ( | const Eina_Matrix4 * | m | ) |

Return the type of the given floating point matrix.

Parameters

  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.15

References EINA_MATRIX_TYPE_AFFINE, and EINA_MATRIX_TYPE_IDENTITY.

Referenced by eina_matrix4_multiply().

## ◆ eina_matrix4_values_set()

EAPI void eina_matrix4_values_set | ( | Eina_Matrix4 * | m,
|  | double | xx,
|  | double | xy,
|  | double | xz,
|  | double | xw,
|  | double | yx,
|  | double | yy,
|  | double | yz,
|  | double | yw,
|  | double | zx,
|  | double | zy,
|  | double | zz,
|  | double | zw,
|  | double | wx,
|  | double | wy,
|  | double | wz,
|  | double | ww
| ) |  |

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

Parameters

  m | The floating point matrix.
  xx | The first coefficient value.
  xy | The second coefficient value.
  xz | The third coefficient value.
  xw | The fourth coefficient value.
  yx | The fifth coefficient value.
  yy | The sixth coefficient value.
  yz | The seventh coefficient value.
  yw | The heighth coefficient value.
  zx | The nineth coefficient value.
  zy | The tenth coefficient value.
  zz | The eleventh coefficient value.
  zw | The twelfth coefficient value.
  wx | The thirteenth coefficient value.
  wy | The fourteenth coefficient value.
  wz | The fifteenth coefficient value.
  ww | The sizteenth coefficient value.

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

See also
  eina_matrix4_values_get()

Since
  1.15

## ◆ eina_matrix4_values_get()

EAPI void eina_matrix4_values_get | ( | const Eina_Matrix4 * | m,
|  | double * | xx,
|  | double * | xy,
|  | double * | xz,
|  | double * | xw,
|  | double * | yx,
|  | double * | yy,
|  | double * | yz,
|  | double * | yw,
|  | double * | zx,
|  | double * | zy,
|  | double * | zz,
|  | double * | zw,
|  | double * | wx,
|  | double * | wy,
|  | double * | wz,
|  | double * | ww
| ) |  |

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

Parameters

  m | The floating point matrix.
  xx | The first coefficient value.
  xy | The second coefficient value.
  xz | The third coefficient value.
  xw | The fourth coefficient value.
  yx | The fifth coefficient value.
  yy | The sixth coefficient value.
  yz | The seventh coefficient value.
  yw | The heighth coefficient value.
  zx | The nineth coefficient value.
  zy | The tenth coefficient value.
  zz | The eleventh coefficient value.
  zw | The twelfth coefficient value.
  wx | The thirteenth coefficient value.
  wy | The fourteenth coefficient value.
  wz | The fifteenth coefficient value.
  ww | The sizteenth coefficient value.

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

See also
  eina_matrix4_values_set()

Since
  1.15

## ◆ eina_matrix4_determinant()

EAPI double eina_matrix4_determinant | ( | const Eina_Matrix4 * | m | ) |

Return the determinant of the given matrix.

Parameters

  m | The matrix.

Returns
  The determinant.

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

Since
  1.16

Referenced by eina_matrix4_normalized().

## ◆ eina_matrix4_normalized()

EAPI Eina_Bool eina_matrix4_normalized | ( | Eina_Matrix4 * | out,
|  | const Eina_Matrix4 * | in
| ) |  |

Return the determinant of the given matrix.

Parameters

  m | The matrix.

Returns
  The determinant.

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

Since
  1.16

References EINA_FALSE, eina_matrix4_determinant(), and EINA_TRUE.

## ◆ eina_matrix4_inverse()

EAPI Eina_Bool eina_matrix4_inverse | ( | Eina_Matrix4 * | out,
|  | const Eina_Matrix4 * | in
| ) |  |

Return the inverse of the given matrix.

Parameters

  out | The inverse matrix
  in | The matrix.

Returns
  `EINA_TRUE` on success, `EINA_FALSE` otherwise.

Since
  1.16

References EINA_FALSE, and EINA_TRUE.

## ◆ eina_matrix4_transpose()

EAPI void eina_matrix4_transpose | ( | Eina_Matrix4 * | out,
|  | const Eina_Matrix4 * | in
| ) |  |

Return the transpose of the given matrix.

Parameters

  out | The transpose matrix
  in | The matrix.

Just going to swap row and column.

Since
  1.16

## ◆ eina_matrix4_matrix3_to()

EAPI void eina_matrix4_matrix3_to | ( | Eina_Matrix3 * | m3,
|  | const Eina_Matrix4 * | m4
| ) |  |

Convert an Eina_Matrix4 into an Eina_Matrix3.

Parameters

  m3 | The destination Eina_Matrix3.
  m4 | The source Eina_Matrix4.

Since
  1.15

## ◆ eina_matrix3_matrix4_to()

EAPI void eina_matrix3_matrix4_to | ( | Eina_Matrix4 * | m4,
|  | const Eina_Matrix3 * | m3
| ) |  |

Convert an Eina_Matrix3 into an Eina_Matrix4.

Parameters

  m3 | The destination Eina_Matrix3.
  m4 | The source Eina_Matrix4.

Since
  1.15

## ◆ eina_matrix4_identity()

EAPI void eina_matrix4_identity | ( | Eina_Matrix4 * | out | ) |

Set an identity matrix.

Parameters

  out | The matrix to set

Since
  1.16

## ◆ eina_matrix4_multiply_copy()

EAPI void eina_matrix4_multiply_copy | ( | Eina_Matrix4 * | out,
|  | const Eina_Matrix4 * | mat_a,
|  | const Eina_Matrix4 * | mat_b
| ) |  |

Multiply two matrix.

Parameters

  out | The resulting matrix
  a | The first member of the multiplication
  b | The second member of the multiplication

Since
  1.17

References eina_matrix4_copy(), and eina_matrix4_multiply().

## ◆ eina_matrix4_array_set()

EAPI void eina_matrix4_array_set | ( | Eina_Matrix4 * | m,
|  | const double * | v
| ) |  |

Set array to matrix.

Parameters

  m | The result matrix
  v | The the array[16] for set

Set to matrix first 16 elements from array

Since
  1.17

## ◆ eina_matrix4_copy()

EAPI void eina_matrix4_copy | ( | Eina_Matrix4 * | dst,
|  | const Eina_Matrix4 * | src
| ) |  |

Copy matrix.

Parameters

  dst | The matrix copy
  src | The matrix for copy.

Since
  1.17

Referenced by eina_matrix4_multiply(), and eina_matrix4_multiply_copy().

## ◆ eina_matrix4_multiply()

EAPI void eina_matrix4_multiply | ( | Eina_Matrix4 * | out,
|  | const Eina_Matrix4 * | mat_a,
|  | const Eina_Matrix4 * | mat_b
| ) |  |

Multiply two matrix with check.

Parameters

  out | The resulting matrix
  a | The first member of the multiplication
  b | The second member of the multiplication

Since
  1.17

References eina_matrix4_copy(), eina_matrix4_type_get(), and EINA_MATRIX_TYPE_IDENTITY.

Referenced by eina_matrix4_multiply_copy().

## ◆ eina_matrix4_ortho_set()

EAPI void eina_matrix4_ortho_set | ( | Eina_Matrix4 * | m,
|  | double | left,
|  | double | right,
|  | double | bottom,
|  | double | top,
|  | double | dnear,
|  | double | dfar
| ) |  |

Set orthogonality matrix.

Parameters

  m | The resulting matrix
  right | The right value
  left | The left value
  bottom | The bottom value
  top | The top value
  dneat | The dnear value
  dfar | The dfar value

Since
  1.17

## ◆ eina_matrix3_array_set()

EAPI void eina_matrix3_array_set | ( | Eina_Matrix3 * | m,
|  | const double * | v
| ) |  |

Set array to matrix.

Parameters

  m | The result matrix
  v | The the array[9] for set

Set to matrix first 9 elements from array

Since
  1.17

## ◆ eina_matrix3_copy()

EAPI void eina_matrix3_copy | ( | Eina_Matrix3 * | dst,
|  | const Eina_Matrix3 * | src
| ) |  |

Copy matrix.

Parameters

  dst | The matrix copy
  src | The matrix for copy.

Since
  1.16

## ◆ eina_matrix3_multiply_copy()

EAPI void eina_matrix3_multiply_copy | ( | Eina_Matrix3 * | out,
|  | const Eina_Matrix3 * | mat_a,
|  | const Eina_Matrix3 * | mat_b
| ) |  |

Multiply two matrix.

Parameters

  out | The resulting matrix
  a | The first member of the multiplication
  b | The second member of the multiplication

Since
  1.17

## ◆ eina_matrix3_scale_transform_set()

EAPI void eina_matrix3_scale_transform_set | ( | Eina_Matrix3 * | out,
|  | double | s_x,
|  | double | s_y
| ) |  |

Transform scale of matrix.

Parameters

  out | The resulting matrix
  s_x | The scale value for x
  s_y | The scale value for y

Since
  1.17

References eina_matrix3_identity().

## ◆ eina_matrix3_position_transform_set()

EAPI void eina_matrix3_position_transform_set | ( | Eina_Matrix3 * | out,
|  | const double | p_x,
|  | const double | p_y
| ) |  |

Transform position of matrix.

Parameters

  out | The resulting matrix
  p_x | The position value for x
  p_y | The position value for y

Since
  1.17

References eina_matrix3_identity().

## ◆ eina_normal3_matrix_get()

EAPI void eina_normal3_matrix_get | ( | Eina_Matrix3 * | out,
|  | const Eina_Matrix4 * | m
| ) |  |

Set normal of the given matrix.

Parameters

  out | The result mtrix of normal
  m | The matrix

Since
  1.17

## ◆ eina_matrix2_values_set()

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

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

Parameters

  m | The floating point matrix.
  xx | The first coefficient value.
  xy | The second coefficient value.
  yx | The fourth coefficient value.
  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()

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

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

Parameters

  m | The floating point matrix.
  xx | The first coefficient value.
  xy | The second coefficient value.
  yx | The fourth coefficient value.
  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()

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

Compute the inverse with check of the given matrix.

Parameters

  m | The matrix to inverse.
  m2 | The inverse matrix.

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

Since
  1.17

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

## ◆ eina_matrix2_identity()

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

Set the given floating point matrix to the identity matrix.

Parameters

  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()

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

Set array to matrix.

Parameters

  m | The rsult matrix
  v | The the array[4] for set

Set to matrix first 4 elements from array

Since
  1.17

## ◆ eina_matrix2_copy()

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

Copy matrix.

Parameters

  dst | The matrix copy
  src | The matrix for copy.

Since
  1.17

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

## ◆ eina_matrix2_multiply()

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

Multiply two matrix.

Parameters

  out | The resulting matrix
  a | The first member of the multiplication
  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()

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

Multiply two matrix with check.

Parameters

  out | The resulting matrix
  a | The first member of the multiplication
  b | The second member of the multiplication

Since
  1.17

References eina_matrix2_copy(), and eina_matrix2_multiply().

## ◆ eina_matrix2_type_get()

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

Return the type of the given floating point matrix.

Parameters

  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_MATRIX_TYPE_AFFINE, and EINA_MATRIX_TYPE_IDENTITY.

Referenced by eina_matrix2_inverse(), and eina_matrix2_multiply().