vector3i.c file
Functions
- auto vec3i_normalize(vector3i v) -> vector3i
- Normalizes a
vector3ito unit length. -
auto vec3i_lerp(vector3i a,
vector3i b,
vm_
float_ t t) -> vector3i - Linearly interpolates between two
vector3i. -
auto vec3i_length(vector3i v) -> vm_
float_ t - Computes the length (magnitude) of a
vector3i. -
auto vec3i_distance(vector3i a,
vector3i b) -> vm_
float_ t - Computes the Euclidean distance between two
vector3i. -
auto vec3i_angle(vector3i a,
vector3i b) -> vm_
float_ t - Computes the angle between two non-zero
vector3iin radians. - auto vec3i_normalize_to_vec3(vector3i v) -> vector3
- Converts to a unit-length vector3.
Function documentation
vector3i vec3i_normalize(vector3i v)
Normalizes a vector3i to unit length.
| Parameters | |
|---|---|
| v | The vector (non-zero). |
| Returns | The normalized vector. |
vector3i vec3i_lerp(vector3i a,
vector3i b,
vm_ float_ t t)
Linearly interpolates between two vector3i.
| Parameters | |
|---|---|
| a | Start vector. |
| b | End vector. |
| t | Interpolation factor [0, 1]. |
| Returns | The interpolated vector (a * (1 - t) + b * t). |
vm_ float_ t vec3i_length(vector3i v)
Computes the length (magnitude) of a vector3i.
| Parameters | |
|---|---|
| v | The vector. |
| Returns | The Euclidean length of v. |
vm_ float_ t vec3i_distance(vector3i a,
vector3i b)
Computes the Euclidean distance between two vector3i.
| Parameters | |
|---|---|
| a | First vector. |
| b | Second vector. |
| Returns | The distance between a and b. |
vm_ float_ t vec3i_angle(vector3i a,
vector3i b)
Computes the angle between two non-zero vector3i in radians.
| Parameters | |
|---|---|
| a | First vector. |
| b | Second vector. |
| Returns | The angle between the directions of a and b. |
vector3 vec3i_normalize_to_vec3(vector3i v)
Converts to a unit-length vector3.
| Parameters | |
|---|---|
| v | Input vector. |
| Returns | The resulting vector3. |