Record TCL3VectorHelper

Unit

Declaration

type TCL3VectorHelper = record helper for TCL3Vector

Description

Record helper for TCL3Vector providing geometric operations specific to grade-1 elements of Cl(3,0).

All operations follow the conventions of Clifford algebra over R3:

Overview

Methods

Public function Conjugate: TCL3Vector;
Public function Cross(const AVector: TCL3Vector): TCL3Vector;
Public function Dot(const AVector: TCL3Bivector): TCL3Vector; overload;
Public function Dot(const AVector: TCL3Multivector): TCL3Multivector; overload;
Public function Dot(const AVector: TCL3Trivector): TCL3Bivector; overload;
Public function Dot(const AVector: TCL3Vector): double; overload;
Public function Dual: TCL3Bivector;
Public function ExtractVector(AComponents: TCL3MultivectorComponents): TCL3Vector;
Public function Inverse: TCL3Vector;
Public function Norm: double;
Public function Normalized: TCL3Vector;
Public function Projection(const AVector: TCL3Bivector): TCL3Vector; overload;
Public function Projection(const AVector: TCL3Multivector): TCL3Multivector; overload;
Public function Projection(const AVector: TCL3Trivector): TCL3Vector; overload;
Public function Projection(const AVector: TCL3Vector): TCL3Vector; overload;
Public function Reciprocal: TCL3Vector;
Public function Reflection(const AVector: TCL3Bivector): TCL3Vector; overload;
Public function Reflection(const AVector: TCL3Multivector): TCL3Multivector; overload;
Public function Reflection(const AVector: TCL3Trivector): TCL3Vector; overload;
Public function Reflection(const AVector: TCL3Vector): TCL3Vector; overload;
Public function Rejection(const AVector: TCL3Bivector): TCL3Vector; overload;
Public function Rejection(const AVector: TCL3Multivector): TCL3Multivector; overload;
Public function Rejection(const AVector: TCL3Trivector): double; overload;
Public function Rejection(const AVector: TCL3Vector): TCL3Vector; overload;
Public function Reverse: TCL3Vector;
Public function Rotation(const AVector1, AVector2: TCL3Bivector): TCL3Vector; overload;
Public function Rotation(const AVector1, AVector2: TCL3Multivector): TCL3Multivector; overload;
Public function Rotation(const AVector1, AVector2: TCL3Trivector): TCL3Vector; overload;
Public function Rotation(const AVector1, AVector2: TCL3Vector): TCL3Vector; overload;
Public function SameValue(const AValue: TCL3Multivector): boolean;
Public function SameValue(const AValue: TCL3Vector): boolean;
Public function SquaredNorm: double;
Public function ToMultivector: TCL3Multivector;
Public function ToString: string;
Public function ToString(APrecision, ADigits: longint): string;
Public function Wedge(const AVector: TCL3Bivector): TCL3Trivector; overload;
Public function Wedge(const AVector: TCL3Multivector): TCL3Multivector; overload;
Public function Wedge(const AVector: TCL3Trivector): double; overload;
Public function Wedge(const AVector: TCL3Vector): TCL3Bivector; overload;

Description

Methods

Public function Conjugate: TCL3Vector;

Returns the Clifford conjugate of the vector. The conjugate combines reversion and grade involution. For a vector (k = 1): v† = -v.

Public function Cross(const AVector: TCL3Vector): TCL3Vector;

Returns the cross product of two vectors. The cross product is the dual of the wedge product: u × v = (u ∧ v)* = -(u ∧ v) · e₁₂₃⁻¹. The result is a vector perpendicular to both operands with magnitude |u||v|sin(θ), specific to ℝ³.

Parameters
AVector
The right operand.
Public function Dot(const AVector: TCL3Bivector): TCL3Vector; overload;

Returns the inner (dot) product of a vector and a bivector. Lowers the grade: grade(1) · grade(2) → grade(1) = vector.

Parameters
AVector
The grade-2 right operand.
Public function Dot(const AVector: TCL3Multivector): TCL3Multivector; overload;

Returns the inner (dot) product of a vector and a multivector. The result is a full TCL3Multivector due to grade mixing.

Parameters
AVector
The right operand.
Public function Dot(const AVector: TCL3Trivector): TCL3Bivector; overload;

Returns the inner (dot) product of a vector and a trivector. Lowers the grade: grade(1) · grade(3) → grade(2) = bivector.

Parameters
AVector
The grade-3 right operand.
Public function Dot(const AVector: TCL3Vector): double; overload;

Returns the inner (dot) product of two vectors. Lowers the grade: grade(1) · grade(1) → grade(0) = scalar. Result: u · v = m1₁·m1₂ + m2₁·m2₂ + m3₁·m3₂.

Parameters
AVector
The grade-1 right operand.
Public function Dual: TCL3Bivector;

Returns the dual of the vector with respect to the pseudoscalar e₁₂₃. The dual maps grade-1 elements to grade-2 (bivector) elements: v* = v · e₁₂₃⁻¹. For example: e₁* = -e₂∧e₃, e₂* = e₁∧e₃, e₃* = -e₁∧e₂.

Public function ExtractVector(AComponents: TCL3MultivectorComponents): TCL3Vector;

Returns a new vector containing only the components specified by AComponents. Components not present in AComponents are set to zero. Useful for extracting specific basis blade contributions from a vector.

Parameters
AComponents
A set of TCL3MultivectorComponent values identifying the components to retain. Valid values are mcm1, mcm2, mcm3.
Public function Inverse: TCL3Vector;

Returns the inverse of the vector under the geometric product. For a non-zero vector v: v⁻¹ = v / |v|², since v² = |v|² > 0 in Cl(3,0).

Public function Norm: double;

Returns the Euclidean norm of the vector: |v| = √(m1² + m2² + m3²). Defined as the square root of v · ṽ = v² since v² ≥ 0 for vectors in Cl(3,0).

Public function Normalized: TCL3Vector;

Returns the unit vector in the same direction. Each component is divided by Norm.

Public function Projection(const AVector: TCL3Bivector): TCL3Vector; overload;

Returns the projection of the vector onto a bivector subspace. Defined as: proj(v, B) = (v · B⁻¹) ∧ B. The result is the component of v lying in the plane of B.

Parameters
AVector
The bivector defining the plane to project onto.
Public function Projection(const AVector: TCL3Multivector): TCL3Multivector; overload;

Returns the projection of the vector onto a multivector subspace. Defined as: proj(v, M) = (v · M⁻¹) ∧ M. The result is a full TCL3Multivector due to grade mixing.

Parameters
AVector
The multivector defining the subspace to project onto.
Public function Projection(const AVector: TCL3Trivector): TCL3Vector; overload;

Returns the projection of the vector onto a trivector subspace. Defined as: proj(v, T) = (v · T⁻¹) ∧ T. Since the trivector spans all of ℝ³, the projection of any vector onto it returns the vector unchanged.

Parameters
AVector
The trivector defining the subspace to project onto.
Public function Projection(const AVector: TCL3Vector): TCL3Vector; overload;

Returns the projection of the vector onto another vector. Defined as: proj(u, v) = (u · v⁻¹) ∧ v = (u · v / |v|²) · v. The result is the component of u parallel to v.

Parameters
AVector
The vector defining the direction to project onto.
Public function Reciprocal: TCL3Vector;

Returns the reciprocal of the vector: ṽ / (v · ṽ). Equivalent to Inverse for non-zero vectors.

Public function Reflection(const AVector: TCL3Bivector): TCL3Vector; overload;

Returns the reflection of the vector through a bivector. Defined as: reflect(v, B) = B · v · B⁻¹. Reflects v through the plane represented by B, reversing the normal component and preserving the in-plane component.

Parameters
AVector
The bivector defining the reflection plane.
Public function Reflection(const AVector: TCL3Multivector): TCL3Multivector; overload;

Returns the reflection of the vector through a multivector. Defined as: reflect(v, M) = M · v · M⁻¹. The result is a full TCL3Multivector due to grade mixing.

Parameters
AVector
The multivector defining the reflection element.
Public function Reflection(const AVector: TCL3Trivector): TCL3Vector; overload;

Returns the reflection of the vector through a trivector. Defined as: reflect(v, T) = T · v · T⁻¹. Since the pseudoscalar commutes with odd-grade elements up to a sign, the reflection through a trivector negates the vector: T·v·T⁻¹ = -v.

Parameters
AVector
The trivector defining the reflection element.
Public function Reflection(const AVector: TCL3Vector): TCL3Vector; overload;

Returns the reflection of the vector through another vector. Defined as: reflect(u, v) = v · u · v⁻¹. Reflects u through the line defined by v, reversing the perpendicular component and preserving the parallel one.

Parameters
AVector
The vector defining the reflection axis.
Public function Rejection(const AVector: TCL3Bivector): TCL3Vector; overload;

Returns the rejection of the vector from a bivector subspace. Defined as: rej(v, B) = v - proj(v, B). The result is the component of v perpendicular to the plane of B.

Parameters
AVector
The bivector defining the plane to reject from.
Public function Rejection(const AVector: TCL3Multivector): TCL3Multivector; overload;

Returns the rejection of the vector from a multivector subspace. Defined as: rej(v, M) = v - proj(v, M). The result is a full TCL3Multivector due to grade mixing.

Parameters
AVector
The multivector defining the subspace to reject from.
Public function Rejection(const AVector: TCL3Trivector): double; overload;

Returns the rejection of the vector from a trivector subspace. Defined as: rej(v, T) = v - proj(v, T). In ℝ³ the rejection of a vector from a trivector is always zero, returned as a scalar 0.

Parameters
AVector
The trivector defining the subspace to reject from.
Public function Rejection(const AVector: TCL3Vector): TCL3Vector; overload;

Returns the rejection of the vector from another vector. Defined as: rej(u, v) = u - proj(u, v). The result is the component of u perpendicular to v.

Parameters
AVector
The vector defining the direction to reject from.
Public function Reverse: TCL3Vector;

Returns the reverse of the vector. The reverse of a grade-k blade changes sign by (-1)ˆ(k·(k-1)/2). For a vector (k = 1): ṽ = v (unchanged).

Public function Rotation(const AVector1, AVector2: TCL3Bivector): TCL3Vector; overload;

Returns the vector rotated by the rotor defined by two bivectors. The rotation is applied as: v' = R · v · R⁻¹.

Parameters
AVector1
The first bivector defining the rotor.
AVector2
The second bivector defining the rotor.
Public function Rotation(const AVector1, AVector2: TCL3Multivector): TCL3Multivector; overload;

Returns the vector rotated by the rotor defined by two multivectors. The rotation is applied as: v' = R · v · R⁻¹. The result is a full TCL3Multivector due to potential grade mixing.

Parameters
AVector1
The first multivector defining the rotor.
AVector2
The second multivector defining the rotor.
Public function Rotation(const AVector1, AVector2: TCL3Trivector): TCL3Vector; overload;

Returns the vector rotated by the rotor defined by two trivectors. The rotation is applied as: v' = R · v · R⁻¹.

Parameters
AVector1
The first trivector defining the rotor.
AVector2
The second trivector defining the rotor.
Public function Rotation(const AVector1, AVector2: TCL3Vector): TCL3Vector; overload;

Returns the vector rotated by the rotor defined by two vectors. The rotor is constructed as R = AVector2 · AVector1 (normalised to a unit rotor). The rotation is applied as: v' = R · v · R⁻¹. The rotation is in the plane spanned by AVector1 and AVector2, by twice the angle between them.

Parameters
AVector1
The first vector defining the rotation plane.
AVector2
The second vector defining the rotation plane.
Public function SameValue(const AValue: TCL3Multivector): boolean;

Returns True if the vector is numerically equal to the given multivector within the default floating point tolerance. All non-vector components of AValue must be negligible.

Parameters
AValue
The multivector to compare against.
Public function SameValue(const AValue: TCL3Vector): boolean;

Returns True if the two vectors are numerically equal within the default floating point tolerance.

Parameters
AValue
The vector to compare against.
Public function SquaredNorm: double;

Returns the squared Euclidean norm of the vector: |v|² = m1² + m2² + m3². Avoids the square root computation of Norm.

Public function ToMultivector: TCL3Multivector;

Converts the vector to a full TCL3Multivector. All components are zero except m1, m2, m3.

Public function ToString: string;

Converts the vector to its default string representation. The format is m1·e₁ + m2·e₂ + m3·e₃.

Public function ToString(APrecision, ADigits: longint): string;

Converts the vector to a formatted string with controlled precision. The format is m1·e₁ + m2·e₂ + m3·e₃.

Parameters
APrecision
Number of significant digits.
ADigits
Minimum number of digits in the output.
Public function Wedge(const AVector: TCL3Bivector): TCL3Trivector; overload;

Returns the outer (wedge) product of a vector and a bivector. Raises the grade: grade(1) ∧ grade(2) → grade(3) = trivector. The result represents the oriented volume spanned by the vector and the bivector.

Parameters
AVector
The grade-2 right operand.
Public function Wedge(const AVector: TCL3Multivector): TCL3Multivector; overload;

Returns the outer (wedge) product of a vector and a multivector. Only components of AVector up to grade 2 contribute to a non-zero result.

Parameters
AVector
The right operand.
Public function Wedge(const AVector: TCL3Trivector): double; overload;

Returns the outer (wedge) product of a vector and a trivector. Always zero in ℝ³: grade(1) ∧ grade(3) → grade(4) = 0.

Parameters
AVector
The grade-3 right operand.
Public function Wedge(const AVector: TCL3Vector): TCL3Bivector; overload;

Returns the outer (wedge) product of two vectors. Raises the grade: grade(1) ∧ grade(1) → grade(2) = bivector. The result represents the oriented plane spanned by the two vectors.

Parameters
AVector
The grade-1 right operand.

Generated by PasDoc 1.0.4.