Floating point vectors in 3D
Eina » Data Types

3D vector definition and operations More...

## Data Structures

struct | _Eina_Vector3

## Functions

static void | eina_vector3_set (Eina_Vector3 *dst, double x, double y, double z)
| Set parameters to vector.
static void | eina_vector3_array_set (Eina_Vector3 *dst, const double *v)
| Set array to vector.
static void | eina_vector3_copy (Eina_Vector3 *dst, const Eina_Vector3 *src)
| Copy vector.
static void | eina_vector3_negate (Eina_Vector3 *out, const Eina_Vector3 *v)
| Make negative vector.
static void | eina_vector3_add (Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b)
| Add two vectors.
static void | eina_vector3_subtract (Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b)
| Subtract two vectors.
static void | eina_vector3_scale (Eina_Vector3 *out, const Eina_Vector3 *v, double scale)
| Scale vector.
static void | eina_vector3_multiply (Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b)
| Multiply two vectors.
static double | eina_vector3_dot_product (const Eina_Vector3 *a, const Eina_Vector3 *b)
| Return the dot product of the two vectors.
static void | eina_vector3_cross_product (Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b)
| Create the cross product of the two vectors.
static double | eina_vector3_length_get (const Eina_Vector3 *v)
| Return the length of the given vector.
static double | eina_vector3_length_square_get (const Eina_Vector3 *v)
| Return the length in square of the given vector.
static double | eina_vector3_distance_get (const Eina_Vector3 *a, const Eina_Vector3 *b)
| Return the distance between of two vectors.
static double | eina_vector3_distance_square_get (const Eina_Vector3 *a, const Eina_Vector3 *b)
| Return the distance in square between of two vectors.
static double | eina_vector3_angle_get (const Eina_Vector3 *a, const Eina_Vector3 *b)
| Return the angle between of two vectors.
static void | eina_vector3_normalize (Eina_Vector3 *out, const Eina_Vector3 *v)
| normalize vector.
static void | eina_vector3_transform (Eina_Vector3 *out, const Eina_Matrix3 *m, const Eina_Vector3 *v)
| Transform vector.
static void | eina_vector3_homogeneous_direction_transform (Eina_Vector3 *out, const Eina_Matrix4 *m, const Eina_Vector3 *v)
| Homogeneous direction transform vector.
static void | eina_vector3_homogeneous_position_transform (Eina_Vector3 *out, const Eina_Matrix4 *m, const Eina_Vector3 *v)
| Homogeneous position transform vector.
static void | eina_vector3_quaternion_rotate (Eina_Vector3 *out, const Eina_Vector3 *v, const Eina_Quaternion *q)
| Rotate vector.
static void | eina_vector3_orthogonal_projection_on_plane (Eina_Vector3 *out, const Eina_Vector3 *v, const Eina_Vector3 *normal)
| Create orthogonal projection on plane between vector and normal.
static void | eina_vector3_plane_by_points (Eina_Quaternion *out, const Eina_Vector3 *a, const Eina_Vector3 *b, const Eina_Vector3 *c)
| Plane by points between three vectors.
static void | eina_vector3_homogeneous_position_set (Eina_Vector3 *out, const Eina_Quaternion *v)
| Homogeneous position set.
static void | eina_vector3_homogeneous_direction_set (Eina_Vector3 *out, const Eina_Quaternion *v)
| Homogeneous direction set.
static Eina_Bool | eina_vector3_equivalent (Eina_Vector3 *a, const Eina_Vector3 *b)
| Check the equivalent between of two vectors.
static Eina_Bool | eina_vector3_triangle_equivalent (Eina_Vector3 *v0, Eina_Vector3 *v1, Eina_Vector3 *v2, Eina_Vector3 *w0, Eina_Vector3 *w1, Eina_Vector3 *w2)
| Check the equivalent between of two triangles of vectors.

## Detailed Description

3D vector definition and operations

## Function Documentation

## eina_vector3_set()

void eina_vector3_set | ( | Eina_Vector3 * | dst,
|  | double | x,
|  | double | y,
|  | double | z )

inline static

Set parameters to vector.

Parameters

  [out] | dst | The resulting vector.
  [in] | x | The x component.
  [in] | y | The y component.
  [in] | z | The z component.

Since
  1.18

## eina_vector3_array_set()

void eina_vector3_array_set | ( | Eina_Vector3 * | dst,
|  | const double * | v )

inline static

Set array to vector.

Parameters

  [out] | dst | The resulting vector.
  [in] | v | The the array[3] for set.

Set to vector first 3 elements from array.

Since
  1.18

## eina_vector3_copy()

void eina_vector3_copy | ( | Eina_Vector3 * | dst,
|  | const Eina_Vector3 * | src )

inline static

Copy vector.

Parameters

  [out] | dst | The vector copy.
  [in] | src | The vector for copy.

Since
  1.18

## eina_vector3_negate()

void eina_vector3_negate | ( | Eina_Vector3 * | out,
|  | const Eina_Vector3 * | v )

inline static

Make negative vector.

Parameters

  [out] | out | The resulting vector.
  [in] | v | The current vector.

Since
  1.18

## eina_vector3_add()

void eina_vector3_add | ( | Eina_Vector3 * | out,
|  | const Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b )

inline static

Add two vectors.

Parameters

  [out] | out | The resulting vector.
  [in] | a | The first member of the add.
  [in] | b | The second member of the add.

Since
  1.18

## eina_vector3_subtract()

void eina_vector3_subtract | ( | Eina_Vector3 * | out,
|  | const Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b )

inline static

Subtract two vectors.

Parameters

  [out] | out | The resulting vector
  [in] | a | The first member of the subtract
  [in] | b | The second member of the subtract

Since
  1.18

## eina_vector3_scale()

void eina_vector3_scale | ( | Eina_Vector3 * | out,
|  | const Eina_Vector3 * | v,
|  | double | scale )

inline static

Scale vector.

Parameters

  [out] | out | The resulting vector.
  [in] | v | The vector for scale.
  [in] | scale | The scale value.

Since
  1.18

## eina_vector3_multiply()

void eina_vector3_multiply | ( | Eina_Vector3 * | out,
|  | const Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b )

inline static

Multiply two vectors.

Parameters

  [out] | out | The resulting vector
  [in] | a | The first member
  [in] | b | The second member

Since
  1.18

## eina_vector3_dot_product()

double eina_vector3_dot_product | ( | const Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b )

inline static

Return the dot product of the two vectors.

Parameters

  [in] | a | The first member.
  [in] | b | The second member.

Returns
  The dot product.

Since
  1.18

## eina_vector3_cross_product()

void eina_vector3_cross_product | ( | Eina_Vector3 * | out,
|  | const Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b )

inline static

Create the cross product of the two vectors.

Parameters

  [out] | out | The resulting vector.
  [in] | a | The first member.
  [in] | b | The second member.

Since
  1.18

## eina_vector3_length_get()

double eina_vector3_length_get | ( | const Eina_Vector3 * | v | ) |

inline static

Return the length of the given vector.

Parameters

  [in] | v | The vector.

Returns
  The length.

Since
  1.18

## eina_vector3_length_square_get()

double eina_vector3_length_square_get | ( | const Eina_Vector3 * | v | ) |

inline static

Return the length in square of the given vector.

Parameters

  [in] | v | The vector.

Returns
  The length in square.

Since
  1.18

## eina_vector3_distance_get()

double eina_vector3_distance_get | ( | const Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b )

inline static

Return the distance between of two vectors.

Parameters

  [in] | a | The first vector.
  [in] | b | The second vector.

Returns
  The distance.

Since
  1.18

## eina_vector3_distance_square_get()

double eina_vector3_distance_square_get | ( | const Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b )

inline static

Return the distance in square between of two vectors.

Parameters

  [in] | a | The first vector.
  [in] | b | The second vector.

Returns
  The distance in square.

Since
  1.18

## eina_vector3_angle_get()

double eina_vector3_angle_get | ( | const Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b )

inline static

Return the angle between of two vectors.

Parameters

  [in] | a | The first vector.
  [in] | b | The second vector.

Returns
  The angle.

Since
  1.18

## eina_vector3_normalize()

void eina_vector3_normalize | ( | Eina_Vector3 * | out,
|  | const Eina_Vector3 * | v )

inline static

normalize vector.

Parameters

  [out] | out | The resulting vector.
  [in] | v | The not NULL vector for normalize.

Since
  1.18

## eina_vector3_transform()

void eina_vector3_transform | ( | Eina_Vector3 * | out,
|  | const Eina_Matrix3 * | m,
|  | const Eina_Vector3 * | v )

inline static

Transform vector.

Parameters

  [out] | out | The resulting vector.
  [in] | m | The matrix for transform.
  [in] | v | The vector for transform.

Since
  1.18

## eina_vector3_homogeneous_direction_transform()

void eina_vector3_homogeneous_direction_transform | ( | Eina_Vector3 * | out,
|  | const Eina_Matrix4 * | m,
|  | const Eina_Vector3 * | v )

inline static

Homogeneous direction transform vector.

Parameters

  [out] | out | The resulting vector.
  [in] | m | The matrix for transform.
  [in] | v | The vector for transform.

Since
  1.18

## eina_vector3_homogeneous_position_transform()

void eina_vector3_homogeneous_position_transform | ( | Eina_Vector3 * | out,
|  | const Eina_Matrix4 * | m,
|  | const Eina_Vector3 * | v )

inline static

Homogeneous position transform vector.

Parameters

  [out] | out | The resulting vector.
  [in] | m | The matrix for transform.
  [in] | v | The vector for transform.

Since
  1.18

## eina_vector3_quaternion_rotate()

void eina_vector3_quaternion_rotate | ( | Eina_Vector3 * | out,
|  | const Eina_Vector3 * | v,
|  | const Eina_Quaternion * | q )

inline static

Rotate vector.

Parameters

  [out] | out | The resulting vector.
  [in] | v | The vector for rotate.
  [in] | q | The quaternion in radians for rotate.

Since
  1.18

## eina_vector3_orthogonal_projection_on_plane()

void eina_vector3_orthogonal_projection_on_plane | ( | Eina_Vector3 * | out,
|  | const Eina_Vector3 * | v,
|  | const Eina_Vector3 * | normal )

inline static

Create orthogonal projection on plane between vector and normal.

Parameters

  [out] | out | The resulting vector.
  [in] | v | The vector for projection.
  [in] | normal | The normal for projection.

Since
  1.18

## eina_vector3_plane_by_points()

void eina_vector3_plane_by_points | ( | Eina_Quaternion * | out,
|  | const Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b,
|  | const Eina_Vector3 * | c )

inline static

Plane by points between three vectors.

Parameters

  [out] | out | The resulting quaternion of plane.
  [in] | a | The first member.
  [in] | b | The second member.
  [in] | c | The third member.

Since
  1.18

## eina_vector3_homogeneous_position_set()

void eina_vector3_homogeneous_position_set | ( | Eina_Vector3 * | out,
|  | const Eina_Quaternion * | v )

inline static

Homogeneous position set.

Parameters

  [out] | out | The resulting vector.
  [in] | v | The quaternion for position.

Since
  1.18

## eina_vector3_homogeneous_direction_set()

void eina_vector3_homogeneous_direction_set | ( | Eina_Vector3 * | out,
|  | const Eina_Quaternion * | v )

inline static

Homogeneous direction set.

Parameters

  [out] | out | The resulting vector.
  [in] | v | The quaternion for direction.

Since
  1.18

## eina_vector3_equivalent()

Eina_Bool eina_vector3_equivalent | ( | Eina_Vector3 * | a,
|  | const Eina_Vector3 * | b )

inline static

Check the equivalent between of two vectors.

Parameters

  [in] | a | The first vector.
  [in] | b | The second vector.

Returns
  The EINA_TRUE if equivalent.

Since
  1.18

## eina_vector3_triangle_equivalent()

Eina_Bool eina_vector3_triangle_equivalent | ( | Eina_Vector3 * | v0,
|  | Eina_Vector3 * | v1,
|  | Eina_Vector3 * | v2,
|  | Eina_Vector3 * | w0,
|  | Eina_Vector3 * | w1,
|  | Eina_Vector3 * | w2 )

inline static

Check the equivalent between of two triangles of vectors.

Parameters

  [in] | v0 | The first member of first triangle.
  [in] | v1 | The second member of first triangle.
  [in] | v2 | The third member of first triangle.
  [in] | w0 | The first member of second triangle.
  [in] | w1 | The second member of second triangle.
  [in] | w2 | The third member of second triangle.

Returns
  The EINA_TRUE if equivalent.

Since
  1.18