Coordinate System
3D Cartesian coordinate system conventions
- Thumb: + x-axis
- Index: + y-axis
- Middle: + z-axis
Right-handed coordinate system
- Maya
Left-handed coordinate system
Vector
A vector is defined by magnitude and direction, and noted as (x, y, z), but do no define positional data. On the other hand, points are noted as (x, y, z) but define positional data.
Magnitude notation can be optimized by not taking the square root.
Scalar values scale vectors. Multiplying by negative scalar values result in a vector pointing in opposite direction of its original direction.
Vectors can be added to other vectors to create new vectors.
Vector with length of 1 is a unit vector. Normalize a vector by dividing each element by the vector's magnitude.
Dot Product
Dot product between 2 vectors results in a scalar value defining the angle between the 2 vectors and to denote if the 2 vectors are pointing in the same general direction or not.
For normalized vectors
Dot product between 2 normalized vectors will always be in range {-1, 1}.
- Dot product > 0, vectors are pointing in same general direction.
- Dot product = 0, vectors are perpendicular to each other.
- Dot product < 0, vectors are pointing in opposite directions.
Dot product of a vector B with a normalized vector A is the projection of vector B onto vector A.
Cross Product
Cross product between 2 vectors results in a new vector perpendicular to the original 2 vectors.
Using this strategy can create a coordinate system with perpendicular vectors. Take the cross product between 2 vectors to create a new vector and then take the cross product between the first vector and the new vector to get the new third vector to create a perpendicular coordinate system.
This is also referred to as an orthonormal basis
.