[ Maverik Level 1 functions ]

#

mav_vectorAdd

mav_vectorAdd, mav_vectorCrossProduct, mav_vectorSet, mav_vectorDotProduct, mav_vectorMult, mav_vectorMult3x3, mav_vectorMult4x4, mav_vectorNormalize, mav_vectorRotate, mav_vectorScalar, mav_vectorSub, mav_vectorMag

## Summary

Vector manipulation utility functions.

## Syntax

MAV_vector mav_vectorAdd(MAV_vector v1, MAV_vector v2);

MAV_vector mav_vectorCrossProduct(MAV_vector v1, MAV_vector v2);

MAV_vector mav_vectorSet(float x, float y, float z);

float mav_vectorDotProduct(MAV_vector v1, MAV_vector v2);

MAV_vector mav_vectorMult(MAV_vector v, MAV_matrix m);

MAV_vector mav_vectorMult3x3(MAV_vector v, MAV_matrix m);

MAV_vector mav_vectorMult4x4(MAV_vector v, MAV_matrix m);

MAV_vector mav_vectorNormalize(MAV_vector v);

MAV_vector mav_vectorRotate(MAV_vector v, MAV_vector ax, float ang);

MAV_vector mav_vectorScalar(MAV_vector v1, float f);

MAV_vector mav_vectorSub(MAV_vector v1, MAV_vector v2);

float mav_vectorMag(MAV_vector v1);

## Description

- mav_vectorAdd adds the two 3D vectors `v1` and `v2`, returning the result vector.

- mav_vectorCrossProduct computes the cross product of the two 3D vectors `v1` and `v2`, and returns the resulting vector.

- mav_vectorSet creates the 3D column vector (`x`,`y`,`z`).

- mav_vectorDotProduct computes the dot product of the two 3D vectors `v1` and `v2` returning the result.

- mav_vectorMult multiplies the 3D vector `v` by the 4x3 matrix `m`, returning the multiplied vector.

- mav_vectorMult3x3 multiplies the 3D vector `v` by the 3x3 matrix `m`, returning the multiplied vector.

- mav_vectorMult4x4 multiplies the 3D vector `v` by the 4x4 matrix `m`, returning the multiplied vector.

- mav_vectorNormalize normalises the 3D vector (`x`,`y`,`z`), returning the normalised vector.

- mav_vectorRotate rotates the vector `v` by `ang` radians about an axis defined by `ax`, which passes through the origin. The resulting rotated vector is returned.

- mav_vectorScalar multiplies the 3D vector `v1` by `f`, and returns the resulting vector.

- mav_vectorSub computes (`v1`-`v2`), and returns the result vector.

- mav_vectorMag computes and returns the magnitude of the vector.

Back to the index page.