float& operator [](long k); |
Returns a reference to the k-th component of a vector. The value of k must be 0, 1, 2, or 3.
|
const float& operator [](long k) const; |
Returns a constant reference to the k-th component of a vector. The value of k must be 0, 1, 2, or 3.
|
Vector4D& operator =(const Vector3D& v); |
Copies the x, y, and z components of v, and assigns a value of 0 to the w component.
|
Vector4D& operator =(const Point3D& p); |
Copies the x, y, and z components of p, and assigns a value of 1 to the w component.
|
Vector4D& operator =(const Vector2D& v); |
Copies the x and y components of v, assigns a value of 0 to the z component, and assigns a value of 0 to the w component.
|
Vector4D& operator =(const Point2D& p); |
Copies the x and y components of p, assigns a value of 0 to the z component, and assigns a value of 1 to the w component.
|
Vector4D& operator +=(const Vector4D& v); |
Adds the vector v.
|
Vector4D& operator +=(const Vector3D& v); |
Adds the vector v. The w component is not modified.
|
Vector4D& operator +=(const Vector2D& v); |
Adds the vector v. The z and w components are not modified.
|
Vector4D& operator -=(const Vector4D& v); |
Subtracts the vector v.
|
Vector4D& operator -=(const Vector3D& v); |
Subtracts the vector v. The w component is not modified.
|
Vector4D& operator -=(const Vector2D& v); |
Subtracts the vector v. The z and w components are not modified.
|
Vector4D& operator *=(float t); |
Multiplies by the scalar t.
|
Vector4D& operator /=(float t); |
Multiplies by the inverse of the scalar t.
|
Vector4D& operator &=(const Vector4D& v); |
Calculates the componentwise product with the vector v.
|
Vector4D operator -(const Vector4D& v); |
Returns the negation of the vector v.
|
Vector4D operator +(const Vector4D& v1, const Vector4D& v2); |
Returns the sum of the vectors v1 and v2.
|
Vector4D operator +(const Vector4D& v1, const Vector3D& v2); |
Returns the sum of the vectors v1 and v2. The w component of v2 is assumed to be 0.
|
Vector4D operator +(const Vector3D& v1, const Vector4D& v2); |
Returns the sum of the vectors v1 and v2. The w component of v1 is assumed to be 0.
|
Vector4D operator +(const Vector4D& v1, const Vector2D& v2); |
Returns the sum of the vectors v1 and v2. The z and w components of v2 are assumed to be 0.
|
Vector4D operator +(const Vector2D& v1, const Vector4D& v2); |
Returns the sum of the vectors v1 and v2. The z and w components of v1 are assumed to be 0.
|
Vector4D operator -(const Vector4D& v1, const Vector4D& v2); |
Returns the difference of the vectors v1 and v2.
|
Vector4D operator -(const Vector4D& v1, const Vector3D& v2); |
Returns the difference of the vectors v1 and v2. The w component of v2 is assumed to be 0.
|
Vector4D operator -(const Vector3D& v1, const Vector4D& v2); |
Returns the difference of the vectors v1 and v2. The w component of v1 is assumed to be 0.
|
Vector4D operator -(const Vector4D& v1, const Vector2D& v2); |
Returns the difference of the vectors v1 and v2. The z and w components of v2 are assumed to be 0.
|
Vector4D operator -(const Vector2D& v1, const Vector4D& v2); |
Returns the difference of the vectors v1 and v2. The z and w components of v1 are assumed to be 0.
|
Vector4D operator *(const Vector4D& v, float t); |
Returns the product of the vector v and the scalar t.
|
Vector4D operator *(float t, const Vector4D& v); |
Returns the product of the vector v and the scalar t.
|
Vector4D operator /(const Vector4D& v, float t); |
Returns the product of the vector v and the inverse of the scalar t.
|
float operator *(const Vector4D& v1, const Vector4D& v2); |
Returns the four-dimensional dot product of the vectors v1 and v2.
|
float operator *(const Vector4D& v1, const Vector3D& v2); |
Returns the dot product of the vectors v1 and v2. The w component of v2 is assumed to be 0.
|
float operator *(const Vector3D& v1, const Vector4D& v2); |
Returns the dot product of the vectors v1 and v2. The w component of v1 is assumed to be 0.
|
float operator *(const Vector4D& v, const Point3D& p); |
Returns the dot product of the vector v and the point p. The w component of p is assumed to be 1. (This gives the distance from a plane (with unit length normal) represented by a Vector4D object to the point p.)
|
float operator *(const Point3D& p, const Vector4D& v); |
Returns the dot product of the point p and the vector v. The w component of p is assumed to be 1.
|
float operator *(const Vector4D& v1, const Vector2D& v2); |
Returns the dot product with the vector v. The z and w components of v are assumed to be 0.
|
float operator *(const Vector2D& v1, const Vector4D& v2); |
Returns the dot product of the vectors v1 and v2. The z and w components of v1 is assumed to be 0.
|
float operator *(const Vector4D& v, const Point2D& p); |
Returns the dot product of the vector v and the point p. The z component of p is assumed to be 0, and the w component of p is assumed to be 1.
|
float operator *(const Point2D& p, const Vector4D& v); |
Returns the dot product of the point p and the vector v. The z component of p is assumed to be 0, and the w component of p is assumed to be 1.
|
Vector3D operator %(const Vector4D& v1, const Vector3D& v2); |
Returns the cross product of the vectors v1 and v2. The w component is ignored.
|
Vector4D operator &(const Vector4D& v1, const Vector4D& v2); |
Returns the componentwise product of the vectors v1 and v2.
|
bool operator ==(const Vector4D& v1, const Vector4D& v2); |
Returns a boolean value indicating the equality of the two vectors v1 and v2.
|
bool operator !=(const Vector4D& v1, const Vector4D& v2); |
Returns a boolean value indicating the inequality of the two vectors v1 and v2
|
float Dot(const Vector4D& v1, const Vector4D& v2); |
Returns the dot product between v1 and v2.
|
Vector4D ProjectOnto(const Vector4D& v1, const Vector4D& v2); |
Returns the projection of v1 onto v2 scaled by the squared magnitude of v2.
|
float Magnitude(const Vector4D& v); |
Returns the magnitude of the vector v.
|
float InverseMag(const Vector4D& v); |
Returns the inverse magnitude of the vector v.
|
float SquaredMag(const Vector4D& v); |
Returns the squared magnitude of the vector v.
|