libft
Loading...
Searching...
No Matches
Functions
vector_utils.c File Reference
#include "libft.h"
+ Include dependency graph for vector_utils.c:

Functions

t_dpoint divide_vector_by_scalar (t_dpoint vec, double scalar)
 Divides a 2D vector by a scalar.
 
t_dpoint get_direction_vector (t_dpoint from, t_dpoint to)
 Computes the vector pointing from one point to another.
 
double get_dot_product (t_dpoint vec1, t_dpoint vec2)
 Computes the dot product of two 2D vectors.
 
t_dpoint get_normalized_vector (t_dpoint vector)
 Returns the normalized (unit length) vector.
 
t_dpoint get_unit_direction_vector (t_dpoint from, t_dpoint to)
 Computes the normalized direction vector between two points.
 
double get_vector_angle (t_dpoint vector)
 Computes the angle of a 2D vector in radians.
 
double get_vector_angle_between (t_dpoint from, t_dpoint to)
 Computes the angle between two points as a direction vector.
 
double get_vector_length (t_dpoint vec)
 Computes the length (magnitude) of a 2D vector.