@} @defgroup cpMat2x2 cpMat2x2 2x2 matrix type used for tensors and such. @{
Convenience constructor for cpVect structs.
Add two vectors
Clamp v to length len.
2D vector cross product analog. The cross product of 2D vectors results in a 3D vector with only a z component. This function returns the magnitude of the z value.
Returns the distance between v1 and v2.
Returns the squared distance between v1 and v2. Faster than cpvdist() when you only need to compare distances.
Vector dot product.
Check if two vectors are equal. (Be careful when comparing floating point numbers!)
Returns the unit length vector for the given angle (in radians).
Returns the length of v.
Returns the squared length of v. Faster than cpvlength() when you only need to compare lengths.
Linearly interpolate between v1 and v2.
Linearly interpolate between v1 towards v2 by distance d.
Scalar multiplication.
Returns true if the distance between v1 and v2 is less than dist.
Negate a vector.
Returns a normalized copy of v.
Returns a perpendicular vector. (90 degree rotation)
Returns the vector projection of v1 onto v2.
Uses complex number multiplication to rotate v1 by v2. Scaling will occur if v1 is not a unit vector.
Returns a perpendicular vector. (-90 degree rotation)
Spherical linearly interpolate between v1 and v2.
Spherical linearly interpolate between v1 towards v2 by no more than angle a radians
Subtract two vectors.
Returns the angular direction v is pointing in (in radians).
Inverse of cpvrotate().