Floating point vectors in 3D

Data Structures | Functions
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. More...
static void | eina_vector3_array_set (Eina_Vector3 *dst, const double *v)
| Set array to vector. More...
static void | eina_vector3_copy (Eina_Vector3 *dst, const Eina_Vector3 *src)
| Copy vector. More...
static void | eina_vector3_negate (Eina_Vector3 *out, const Eina_Vector3 *v)
| Make negative vector. More...
static void | eina_vector3_add (Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b)
| Add two vectors. More...
static void | eina_vector3_subtract (Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b)
| Subtract two vectors. More...
static void | eina_vector3_scale (Eina_Vector3 *out, const Eina_Vector3 *v, double scale)
| Scale vector. More...
static void | eina_vector3_multiply (Eina_Vector3 *out, const Eina_Vector3 *a, const Eina_Vector3 *b)
| Multiply two vectors. More...
static double | eina_vector3_dot_product (const Eina_Vector3 *a, const Eina_Vector3 *b)
| Return the dot product of the two vectors. More...
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. More...
static double | eina_vector3_length_get (const Eina_Vector3 *v)
| Return the length of the given vector. More...
static double | eina_vector3_length_square_get (const Eina_Vector3 *v)
| Return the length in square of the given vector. More...
static double | eina_vector3_distance_get (const Eina_Vector3 *a, const Eina_Vector3 *b)
| Return the distance between of two vectors. More...
static double | eina_vector3_distance_square_get (const Eina_Vector3 *a, const Eina_Vector3 *b)
| Return the distance in square between of two vectors. More...
static double | eina_vector3_angle_get (const Eina_Vector3 *a, const Eina_Vector3 *b)
| Return the angle between of two vectors. More...
static void | eina_vector3_normalize (Eina_Vector3 *out, const Eina_Vector3 *v)
| normalize vector. More...
static void | eina_vector3_transform (Eina_Vector3 *out, const Eina_Matrix3 *m, const Eina_Vector3 *v)
| Transform vector. More...
static void | eina_vector3_homogeneous_direction_transform (Eina_Vector3 *out, const Eina_Matrix4 *m, const Eina_Vector3 *v)
| Homogeneous direction transform vector. More...
static void | eina_vector3_homogeneous_position_transform (Eina_Vector3 *out, const Eina_Matrix4 *m, const Eina_Vector3 *v)
| Homogeneous position transform vector. More...
static void | eina_vector3_quaternion_rotate (Eina_Vector3 *out, const Eina_Vector3 *v, const Eina_Quaternion *q)
| Rotate vector. More...
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. More...
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. More...
static void | eina_vector3_homogeneous_position_set (Eina_Vector3 *out, const Eina_Quaternion *v)
| Homogeneous position set. More...
static void | eina_vector3_homogeneous_direction_set (Eina_Vector3 *out, const Eina_Quaternion *v)
| Homogeneous direction set. More...
static Eina_Bool | eina_vector3_equivalent (Eina_Vector3 *a, const Eina_Vector3 *b)
| Check the equivalent between of two vectors. More...
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. More...

## Detailed Description

3D vector definition and operations

## Function Documentation

## ◆ eina_vector3_set()

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

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

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

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

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

Copy vector.

Parameters

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

Since
  1.18

## ◆ eina_vector3_negate()

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

Make negative vector.

Parameters

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

Since
  1.18

## ◆ eina_vector3_add()

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

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

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

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

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

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

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

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

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

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

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

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

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

Return the length of the given vector.

Parameters

  [in] | v | The vector.

Returns
  The length.

Since
  1.18

## ◆ eina_vector3_length_square_get()

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

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

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

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

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

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

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

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

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

normalize vector.

Parameters

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

Since
  1.18

## ◆ eina_vector3_transform()

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

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

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

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

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

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

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

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

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

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

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

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

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

Homogeneous position set.

Parameters

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

Since
  1.18

## ◆ eina_vector3_homogeneous_direction_set()

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

Homogeneous direction set.

Parameters

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

Since
  1.18

## ◆ eina_vector3_equivalent()

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

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

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

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