C4 Engine
C4 Engine API Documentation

class Line3D

Defined in:  TSLine3D.h
The Line3D class encapsulates a 3D line.
Definition

class Line3D

Member Functions
Line3D::Set Sets all six components of a line.
Line3D::Unitize Unitizes the weight of a line.
Constructor

Line3D();

Line3D(float vx, float vy, float vz, float mx, float my, float mz);

Line3D(const Vector3D& direction, const Bivector3D& moment);

Parameters
vx,vy,vz The three components of the direction of the line.
mx,my,mz The three components of the moment of the line.
direction A 3D vector corresponding to the direction of the line.
moment A 3D bivector corresponding to the moment of the line.
Description
The Line3D class is used to store a three dimensional line represented as a four-dimensional bivector having six floating-point components. The components of the line are stored as a Vector3D member named direction and a Bivector3D member named moment.

The default constructor leaves the components of the line undefined.
Overloaded Operators
Line3D& operator *=(float n); Multiplies by the scalar n.
Line3D& operator /=(float n); Multiplies by the inverse of the scalar n.
Nonmember Operations
bool operator ==(const Line3D& k, const Line3D& l); Returns a boolean value indicating whether the two lines k and l are equal.
bool operator !=(const Line3D& k, const Line3D& l); Returns a boolean value indicating whether the two lines k and l are not equal.
Line3D operator ~(const Line3D& l); Returns the antireverse of the line l.
Line3D operator -(const Line3D& l); Returns the negation of the line l.
Line3D operator *(const Line3D& l, float n); Returns the product of the line l and the scalar n.
Line3D operator *(float n, const Line3D& l); Returns the product of the line l and the scalar n.
Line3D operator /(const Line3D& l, float n); Returns the product of the line l and the inverse of the scalar n.
Line3D operator ^(const Point3D& p, const Point3D& q); Returns the wedge product of the points p and q. The w coordinates of p and q are assumed to be 1.
float operator ^(const Line3D& k, const Line3D& l); Returns the antiwedge product of the lines k and l. This gives the crossing relationship between the two lines, with positive values representing clockwise crossings and negative values representing counterclockwise crossings.
float BulkNorm(const Line3D& l); Returns the bulk norm of the line l.
float WeightNorm(const Line3D& l); Returns the weight norm of the line l.
Point3D Project(const Point3D& p, const Line3D& l); Returns the projection of the point p onto the line l under the assumption that the line is unitized.
Line3D Antiproject(const Line3D& l, const Point3D& p); Returns the antiprojection of the line l onto the point p (where p is always unitized because it has an implicit w coordinate of 1).
See Also

Vector4D

Plane3D

Motor3D