Facebook Twitter YouTube

class Trivector4D

Defined in:  TSTrivector4D.h
The Trivector4D class encapsulates a 4D trivector.
Definition

class Trivector4D

Member Functions
Trivector4D::Set Sets all four components of a trivector.
Trivector4D::SetStandard Sets a trivector to the plane containing three points and standardizes it.
Trivector4D::Normalize Normalizes a 4D trivector.
Trivector4D::Standardize Standardizes a 4D trivector.
Trivector4D::GetAntivector3D Returns a reference to an Antivector3D object.
Constructor

Trivector4D();

Trivector4D(float a, float b, float c, float d);

Trivector4D(const Antivector3D& n, float d);

Trivector4D(const Antivector3D& n, const Point3D& p);

Trivector4D(const Point3D& p1, const Point3D& p2, const Point3D& p3);

Parameters
a The value of the x coordinate.
b The value of the y coordinate.
c The value of the z coordinate.
d The value of the w coordinate.
n A 3D antivector whose entries are copied to the x, y, and z coordinates.
p A 3D point lying in the plane.
p1,p2,p3 Three 3D points that lie in the plane.
Description
The Trivector4D class is used to store a four-dimensional trivector having floating-point components x, y, z, and w.

The default constructor leaves the components of the trivector undefined. If the values a, b, c, and d are supplied, then they are assigned to the x, y, z, and w coordinates of the trivector, respectively.

If the p parameter is specified, then the w coordinate is given by −(n ∧ p). If the p1, p2, and p3 parameters are specified, then the trivector is set to the triple wedge product p1 ∧ p2 ∧ p3.
Overloaded Operators
floatoperator [](machine k); Returns a reference to the k-th component of a trivector. The value of k must be 0, 1, 2, or 3.
const floatoperator [](machine k) const; Returns a constant reference to the k-th component of a trivector. The value of k must be 0, 1, 2, or 3.
Trivector4D& operator *=(float s); Multiplies by the scalar s.
Trivector4D& operator /=(float s); Multiplies by the inverse of the scalar s.
Nonmember Operations
Trivector4D operator -(const Trivector4D& v); Returns the negation of the trivector v.
Trivector4D operator *(const Trivector4D& v, float s); Returns the product of the trivector v and the scalar s.
Trivector4D operator *(float s, const Trivector4D& v); Returns the product of the trivector v and the scalar s.
Trivector4D operator /(const Trivector4D& v, float s); Returns the product of the trivector v and the inverse of the scalar s.
float operator ^(const Trivector4D& a, const Vector4D& b); Returns the negative antiwedge product of the trivector a and the vector b. (The negative value is returned because vectors and trivectors anticommute in four dimensions.)
float operator ^(const Vector4D& a, const Trivector4D& b); Returns the antiwedge product of the vector a and the trivector b.
float operator ^(const Trivector4D& a, const Vector3D& b); Returns the negative antiwedge product of the trivector a and the vector b. The w coordinate of b is assumed to be 0. (The negative value is returned because vectors and trivectors anticommute in four dimensions.)
float operator ^(const Trivector4D& v, const Point3D& p); Returns the negative antiwedge product of the trivector v and the point p. The w coordinate of p is assumed to be 1. (The negative value is returned because vectors and trivectors anticommute in four dimensions.) This gives the distance from a plane, with standardized normal, represented by an Trivector4D object to the point p.
float operator ^(const Trivector4D& v, const Point2D& p); Returns the negative antiwedge product of the trivector v and the point p. The z coordinate of p is assumed to be 0, and the w coordinate of p is assumed to be 1. (The negative value is returned because vectors and trivectors anticommute in four dimensions.) This gives the distance from a plane, with standardized normal, represented by an Trivector4D object to the point p.
bool operator ==(const Trivector4D& a, const Trivector4D& b); Returns a boolean value indicating the equality of the two trivectors a and b.
bool operator !=(const Trivector4D& a, const Trivector4D& b); Returns a boolean value indicating the inequality of the two trivectors a and b
See Also

Vector4D

Point3D

Point2D