Data Structures | Functions
Floating point vectors in 3D

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]dstThe resulting vector.
[in]xThe x component.
[in]yThe y component.
[in]zThe 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]dstThe resulting vector.
[in]vThe 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]dstThe vector copy.
[in]srcThe 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]outThe resulting vector.
[in]vThe 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]outThe resulting vector.
[in]aThe first member of the add.
[in]bThe 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]outThe resulting vector
[in]aThe first member of the subtract
[in]bThe 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]outThe resulting vector.
[in]vThe vector for scale.
[in]scaleThe 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]outThe resulting vector
[in]aThe first member
[in]bThe 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]aThe first member.
[in]bThe 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]outThe resulting vector.
[in]aThe first member.
[in]bThe 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]vThe 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]vThe 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]aThe first vector.
[in]bThe 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]aThe first vector.
[in]bThe 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]aThe first vector.
[in]bThe 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]outThe resulting vector.
[in]vThe 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]outThe resulting vector.
[in]mThe matrix for transform.
[in]vThe 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]outThe resulting vector.
[in]mThe matrix for transform.
[in]vThe 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]outThe resulting vector.
[in]mThe matrix for transform.
[in]vThe 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]outThe resulting vector.
[in]vThe vector for rotate.
[in]qThe 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]outThe resulting vector.
[in]vThe vector for projection.
[in]normalThe 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]outThe resulting quaternion of plane.
[in]aThe first member.
[in]bThe second member.
[in]cThe 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]outThe resulting vector.
[in]vThe 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]outThe resulting vector.
[in]vThe 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]aThe first vector.
[in]bThe 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]v0The first member of first triangle.
[in]v1The second member of first triangle.
[in]v2The third member of first triangle.
[in]w0The first member of second triangle.
[in]w1The second member of second triangle.
[in]w2The third member of second triangle.
Returns
The EINA_TRUE if equivalent.
Since
1.18