# Vector math

Therse are common functions used in vector math

### f_length2f

float f_length2f(float *vec);

Description: Computes the length of a vector 2D for 32 bit floats.

### f_length3f

float f_length3f(float *vec);

Description: Computes the length of a vector 3D for 32 bit floats.

### f_distance2f

float f_distance2f(float *a, float *b);

Description: Computes the distance between two points in 2D for 32 bit floats.

### f_distance3f

float f_distance3f(float *a, float *b);

Description: Computes the distance between two points in 3D for 32 bit floats.

### f_dot2f

float f_dot2f(float *a, float *b);

Description: Computes the dot product between two points in 2D for 32 bit floats.

### f_dot3f

float f_dot3f(float *a, float *b);

Description: Computes the dot product between two points in 3D for 32 bit floats.

### f_cross2f

void f_cross2f(float *output, float *a, float *b);

Description: Computes cross product between two points in 2D for 32 bit floats.

### f_cross3f

void f_cross3f(float *output, float *a, float *b);

Description: Computes cross product between two points in 3D for 32 bit floats.

### f_normalize2f

void f_normalize2f(float *vec);

Description: Normalizes a 2D vector of 32 bit floats.

### f_normalize3f

void f_normalize3f(float *vec);

Description: Normalizes a 3D vector of 32 bit floats.

### f_normalize4f

void f_normalize4f(float *vec);

Description: Normalizes a 4D vector of 32 bit floats (useful for quaternions).

### f_normal2f

void f_normal2f(float *output, float *a, float *b);

Description: Generates a normal from 2 points on a line.

### f_normal3f

void f_normal3f(float *output, float *a, float *b, float *c);

Description: Generates a normal from 3 points on a plane.

### f_reflect2f

void f_reflect2f(float *output, float *pos, float *normal);

Description: Reflects a position to a normal plane in 2D for 32 bit floats.

### f_reflect3f

void f_reflect3f(float *output, float *pos, float *normal);

Description: Reflects a position to a normal plane in 3D for 32 bit floats.

### f_flatten2f

void f_flatten2f(float *output, float *pos, float *normal);

Description: Flattens a position to a normal plane in 2D for 32 bit floats.

### f_flatten3f

void f_flatten3f(float *output, float *pos, float *normal);

Description: Flattens a position to a normal plane in 3D for 32 bit floats.

### f_project2f

void f_project2f(float *output, float *plane_pos, float *normal, float *pos, float *vector);

Description: projects from aposition along a vector on to a positioned planein 2D for 32 bit floats.

### f_project3f

void f_project3f(float *output, float *plane_pos, float *normal, float *pos, float *vector);

Description: projects fr0m aposition along a vector on to a positioned planein 3D for 32 bit floats.

### f_intersect2f

void f_intersect2f(float *output, float *line_a0, float *line_a1, float *line_b0, float *line_b1);

Description: Computes the intersection between two lines in 2D for 32 bit floats.

### f_length2d

double f_length2d(double *vec);

Description: Computes the length of a vector 2D for 64 bit doubles.

### f_length3d

double f_length3d(double *vec);

Description: Computes the length of a vector 3D for 64 bit doubles.

### f_distance2d

double f_distance2d(double *a, double *b);

Description: Computes the distance between two points in 2D for 64 bit doubles.

### f_distance3d

double f_distance3d(double *a, double *b);

Description: Computes the distance between two points in 3D for 64 bit doubles.

### f_dot2d

double f_dot2d(double *a, double *b);

Description: Computes the dot product between two points in 2D for 64 bit doubles.

### f_dot3d

double f_dot3d(double *a, double *b);

Description: Computes the dot product between two points in 3D for 64 bit doubles.

### f_cross2d

void f_cross2d(double *output, double *a, double *b);

Description: Computes cross product between two points in 2D for 64 bit doubles.

### f_cross3d

void f_cross3d(double *output, double *a, double *b);

Description: Computes cross product between two points in 3D for 64 bit doubles.

### f_normalize2d

void f_normalize2d(double *vec);

Description: Normalizes a 2D vector of 64 bit doubles.

### f_normalize3d

void f_normalize3d(double *vec);

Description: Normalizes a 3D vector of 64 bit doubles.

### f_normalize4d

void f_normalize4d(double *vec);

Description: Normalizes a 4D vector of 64 bit doubles (useful for quaternions).

### f_normal2d

void f_normal2d(double *output, double *a, double *b);

Description: Generates a normal from 2 points on a line.

### f_normal3d

void f_normal3d(double *output, double *a, double *b, double *c);

Description: Generates a normal from 3 points on a plane.

### f_reflect2d

void f_reflect2d(double *output, double *pos, double *normal);

Description: Reflects a position to a normal plane in 2D for 64 bit doubles.

### f_reflect3d

void f_reflect3d(double *output, double *pos, double *normal);

Description: Reflects a position to a normal plane in 3D for 64 bit doubles.

### f_flatten2d

void f_flatten2d(double *output, double *pos, double *normal);

Description: Flattens a position to a normal plane in 2D for 64 bit doubles.

### f_flatten3d

void f_flatten3d(double *output, double *pos, double *normal);

Description: Flattens a position to a normal plane in 3D for 64 bit doubles.

### f_project2d

void f_project2d(double *output, double *plane_pos, double *normal, double *pos, double *vector);

Description: projects from aposition along a vector on to a positioned planein 2D for 64 bit doubles.

### f_project3d

void f_project3d(double *output, double *plane_pos, double *normal, double *pos, double *vector);

Description: projects fr0m aposition along a vector on to a positioned planein 3D for 64 bit doubles.

### f_intersect2d

void f_intersect2d(double *output, double *line_a0, double *line_a1, double *line_b0, double *line_b1);

Description: Computes the intersection between two lines in 2D for 64 bit doubles.