Unit geometry

DescriptionusesClasses, Interfaces and ObjectsFunctions and ProceduresTypesConstantsVariables

Description

 

Classes, Interfaces and Objects

NameDescription
record TQuaternion  
record TRectangle  

Functions and Procedures

Overview

function VectorAdd(V1, V2: TVector): TVector;
function VectorAffineAdd(V1, V2: TAffineVector): TAffineVector;
function VectorAffineCombine(V1, V2: TAffineVector; F1, F2: Single): TAffineVector;
function VectorAffineDotProduct(V1, V2: TAffineVector): Single;
function VectorAffineLerp(V1, V2: TAffineVector; t: Single): TAffineVector;
function VectorAffineSubtract(V1, V2: TAffineVector): TAffineVector;
function VectorAngle(V1, V2: TAffineVector): Single;
function VectorCombine(V1, V2: TVector; F1, F2: Single): TVector;
function VectorCrossProduct(V1, V2: TAffineVector): TAffineVector;
function VectorDotProduct(V1, V2: TVector): Single;
function VectorLength(V: array of Single): Single;
function VectorLerp(V1, V2: TVector; t: Single): TVector;
procedure VectorNegate(V: array of Single);
function VectorNorm(V: array of Single): Single;
function VectorNormalize(V: array of Single): Single;
function VectorPerpendicular(V, N: TAffineVector): TAffineVector;
function VectorReflect(V, N: TAffineVector): TAffineVector;
procedure VectorRotate(var Vector: TVector4f; Axis: TVector3f; Angle: Single);
procedure VectorScale(V: array of Single; Factor: Single);
function VectorSubtract(V1, V2: TVector): TVector;
function CreateRotationMatrixX(Sine, Cosine: Single): TMatrix;
function CreateRotationMatrixY(Sine, Cosine: Single): TMatrix;
function CreateRotationMatrixZ(Sine, Cosine: Single): TMatrix;
function CreateScaleMatrix(V: TAffineVector): TMatrix;
function CreateTranslationMatrix(V: TVector): TMatrix;
procedure MatrixAdjoint(var M: TMatrix);
function MatrixAffineDeterminant(M: TAffineMatrix): Single;
procedure MatrixAffineTranspose(var M: TAffineMatrix);
function MatrixDeterminant(M: TMatrix): Single;
procedure MatrixInvert(var M: TMatrix);
function MatrixMultiply(M1, M2: TMatrix): TMatrix;
procedure MatrixScale(var M: TMatrix; Factor: Single);
procedure MatrixTranspose(var M: TMatrix);
function QuaternionConjugate(Q: TQuaternion): TQuaternion;
function QuaternionFromPoints(V1, V2: TAffineVector): TQuaternion;
function QuaternionMultiply(qL, qR: TQuaternion): TQuaternion;
function QuaternionSlerp(QStart, QEnd: TQuaternion; Spin: Integer; t: Single): TQuaternion;
function QuaternionToMatrix(Q: TQuaternion): TMatrix;
procedure QuaternionToPoints(Q: TQuaternion; var ArcFrom, ArcTo: TAffineVector);
function ConvertRotation(Angles: TAffineVector): TVector;
function CreateRotationMatrix(Axis: TVector3f; Angle: Single): TMatrix;
function MatrixDecompose(M: TMatrix; var Tran: TTransformations): Boolean;
function VectorAffineTransform(V: TAffineVector; M: TAffineMatrix): TAffineVector;
function VectorTransform(V: TVector4f; M: TMatrix): TVector4f; overload;
function VectorTransform(V: TVector3f; M: TMatrix): TVector3f; overload;
function MakeAffineDblVector(V: array of Double): TAffineDblVector;
function MakeDblVector(V: array of Double): THomogeneousDblVector;
function MakeAffineVector(V: array of Single): TAffineVector;
function MakeQuaternion(Imag: array of Single; Real: Single): TQuaternion;
function MakeVector(V: array of Single): TVector;
function PointInPolygon(xp, yp : array of Single; x, y: Single): Boolean;
function VectorAffineDblToFlt(V: TAffineDblVector): TAffineVector;
function VectorDblToFlt(V: THomogeneousDblVector): THomogeneousVector;
function VectorAffineFltToDbl(V: TAffineVector): TAffineDblVector;
function VectorFltToDbl(V: TVector): THomogeneousDblVector;
function ArcCos(X: Extended): Extended;
function ArcSin(X: Extended): Extended;
function ArcTan2(Y, X: Extended): Extended;
function CoTan(X: Extended): Extended;
function DegToRad(Degrees: Extended): Extended;
function RadToDeg(Radians: Extended): Extended;
procedure SinCos(Theta: Extended; var Sin, Cos: Extended);
function Tan(X: Extended): Extended;
function Turn(Matrix: TMatrix; Angle: Single): TMatrix; overload;
function Turn(Matrix: TMatrix; MasterUp: TAffineVector; Angle: Single): TMatrix; overload;
function Pitch(Matrix: TMatrix; Angle: Single): TMatrix; overload;
function Pitch(Matrix: TMatrix; MasterRight: TAffineVector; Angle: Single): TMatrix; overload;
function Roll(Matrix: TMatrix; Angle: Single): TMatrix; overload;
function Roll(Matrix: TMatrix; MasterDirection: TAffineVector; Angle: Single): TMatrix; overload;

Description

function ArcCos(X: Extended): Extended;

 

function ArcSin(X: Extended): Extended;

 

function ArcTan2(Y, X: Extended): Extended;

 

function ConvertRotation(Angles: TAffineVector): TVector;

 

function CoTan(X: Extended): Extended;

 

function CreateRotationMatrix(Axis: TVector3f; Angle: Single): TMatrix;

 

function CreateRotationMatrixX(Sine, Cosine: Single): TMatrix;

 

function CreateRotationMatrixY(Sine, Cosine: Single): TMatrix;

 

function CreateRotationMatrixZ(Sine, Cosine: Single): TMatrix;

 

function CreateScaleMatrix(V: TAffineVector): TMatrix;

 

function CreateTranslationMatrix(V: TVector): TMatrix;

 

function DegToRad(Degrees: Extended): Extended;

 

function MakeAffineDblVector(V: array of Double): TAffineDblVector;

 

function MakeAffineVector(V: array of Single): TAffineVector;

 

function MakeDblVector(V: array of Double): THomogeneousDblVector;

 

function MakeQuaternion(Imag: array of Single; Real: Single): TQuaternion;

 

function MakeVector(V: array of Single): TVector;

 

procedure MatrixAdjoint(var M: TMatrix);

 

function MatrixAffineDeterminant(M: TAffineMatrix): Single;

 

procedure MatrixAffineTranspose(var M: TAffineMatrix);

 

function MatrixDecompose(M: TMatrix; var Tran: TTransformations): Boolean;

 

function MatrixDeterminant(M: TMatrix): Single;

 

procedure MatrixInvert(var M: TMatrix);

 

function MatrixMultiply(M1, M2: TMatrix): TMatrix;

 

procedure MatrixScale(var M: TMatrix; Factor: Single);

 

procedure MatrixTranspose(var M: TMatrix);

 

function Pitch(Matrix: TMatrix; Angle: Single): TMatrix; overload;

 

function Pitch(Matrix: TMatrix; MasterRight: TAffineVector; Angle: Single): TMatrix; overload;

 

function PointInPolygon(xp, yp : array of Single; x, y: Single): Boolean;

 

function QuaternionConjugate(Q: TQuaternion): TQuaternion;

 

function QuaternionFromPoints(V1, V2: TAffineVector): TQuaternion;

 

function QuaternionMultiply(qL, qR: TQuaternion): TQuaternion;

 

function QuaternionSlerp(QStart, QEnd: TQuaternion; Spin: Integer; t: Single): TQuaternion;

 

function QuaternionToMatrix(Q: TQuaternion): TMatrix;

 

procedure QuaternionToPoints(Q: TQuaternion; var ArcFrom, ArcTo: TAffineVector);

 

function RadToDeg(Radians: Extended): Extended;

 

function Roll(Matrix: TMatrix; Angle: Single): TMatrix; overload;

 

function Roll(Matrix: TMatrix; MasterDirection: TAffineVector; Angle: Single): TMatrix; overload;

 

procedure SinCos(Theta: Extended; var Sin, Cos: Extended);

 

function Tan(X: Extended): Extended;

 

function Turn(Matrix: TMatrix; MasterUp: TAffineVector; Angle: Single): TMatrix; overload;

 

function Turn(Matrix: TMatrix; Angle: Single): TMatrix; overload;

 

function VectorAdd(V1, V2: TVector): TVector;

 

function VectorAffineAdd(V1, V2: TAffineVector): TAffineVector;

 

function VectorAffineCombine(V1, V2: TAffineVector; F1, F2: Single): TAffineVector;

 

function VectorAffineDblToFlt(V: TAffineDblVector): TAffineVector;

 

function VectorAffineDotProduct(V1, V2: TAffineVector): Single;

 

function VectorAffineFltToDbl(V: TAffineVector): TAffineDblVector;

 

function VectorAffineLerp(V1, V2: TAffineVector; t: Single): TAffineVector;

 

function VectorAffineSubtract(V1, V2: TAffineVector): TAffineVector;

 

function VectorAffineTransform(V: TAffineVector; M: TAffineMatrix): TAffineVector;

 

function VectorAngle(V1, V2: TAffineVector): Single;

 

function VectorCombine(V1, V2: TVector; F1, F2: Single): TVector;

 

function VectorCrossProduct(V1, V2: TAffineVector): TAffineVector;

 

function VectorDblToFlt(V: THomogeneousDblVector): THomogeneousVector;

 

function VectorDotProduct(V1, V2: TVector): Single;

 

function VectorFltToDbl(V: TVector): THomogeneousDblVector;

 

function VectorLength(V: array of Single): Single;

 

function VectorLerp(V1, V2: TVector; t: Single): TVector;

 

procedure VectorNegate(V: array of Single);

 

function VectorNorm(V: array of Single): Single;

 

function VectorNormalize(V: array of Single): Single;

 

function VectorPerpendicular(V, N: TAffineVector): TAffineVector;

 

function VectorReflect(V, N: TAffineVector): TAffineVector;

 

procedure VectorRotate(var Vector: TVector4f; Axis: TVector3f; Angle: Single);

 

procedure VectorScale(V: array of Single; Factor: Single);

 

function VectorSubtract(V1, V2: TVector): TVector;

 

function VectorTransform(V: TVector3f; M: TMatrix): TVector3f; overload;

 

function VectorTransform(V: TVector4f; M: TMatrix): TVector4f; overload;

 

Types

NameDescription
PByte = ^Byte;  
PWord = ^Word;  
PInteger = ^Integer;  
PFloat = ^Single;  
PDouble = ^Double;  
PExtended = ^Extended;  
PPointer = ^Pointer;  
PByteVector = ^TByteVector;  
PByteArray = PByteVector;  
TByteVector = array[0..0] of Byte;  
PWordVector = ^TWordVector;  
PWordArray = PWordVector;  
TWordVector = array[0..0] of Word;  
PIntegerVector = ^TIntegerVector;  
PIntegerArray = PIntegerVector;  
TIntegerVector = array[0..0] of Integer;  
PFloatVector = ^TFloatVector;  
PFloatArray = PFloatVector;  
TFloatVector = array[0..0] of Single;  
PDoubleVector = ^TDoubleVector;  
PDoubleArray = PDoubleVector;  
TDoubleVector = array[0..0] of Double;  
PExtendedVector = ^TExtendedVector;  
PExtendedArray = PExtendedVector;  
TExtendedVector = array[0..0] of Extended;  
PPointerVector = ^TPointerVector;  
PPointerArray = PPointerVector;  
TPointerVector = array[0..0] of Pointer;  
PCardinalVector = ^TCardinalVector;  
PCardinalArray = PCardinalVector;  
TCardinalVector = array[0..0] of Cardinal;  
PHomogeneousByteVector = ^THomogeneousByteVector;  
THomogeneousByteVector = array[0..3] of Byte;  
TVector4b = THomogeneousByteVector;  
PHomogeneousWordVector = ^THomogeneousWordVector;  
THomogeneousWordVector = array[0..3] of Word;  
TVector4w = THomogeneousWordVector;  
PHomogeneousIntVector = ^THomogeneousIntVector;  
THomogeneousIntVector = array[0..3] of Integer;  
TVector4i = THomogeneousIntVector;  
PHomogeneousFltVector = ^THomogeneousFltVector;  
THomogeneousFltVector = array[0..3] of Single;  
TVector4f = THomogeneousFltVector;  
PHomogeneousDblVector = ^THomogeneousDblVector;  
THomogeneousDblVector = array[0..3] of Double;  
TVector4d = THomogeneousDblVector;  
PHomogeneousExtVector = ^THomogeneousExtVector;  
THomogeneousExtVector = array[0..3] of Extended;  
TVector4e = THomogeneousExtVector;  
PHomogeneousPtrVector = ^THomogeneousPtrVector;  
THomogeneousPtrVector = array[0..3] of Pointer;  
TVector4p = THomogeneousPtrVector;  
PAffineByteVector = ^TAffineByteVector;  
TAffineByteVector = array[0..2] of Byte;  
TVector3b = TAffineByteVector;  
PAffineWordVector = ^TAffineWordVector;  
TAffineWordVector = array[0..2] of Word;  
TVector3w = TAffineWordVector;  
PAffineIntVector = ^TAffineIntVector;  
TAffineIntVector = array[0..2] of Integer;  
TVector3i = TAffineIntVector;  
PAffineFltVector = ^TAffineFltVector;  
TAffineFltVector = array[0..2] of Single;  
TVector3f = TAffineFltVector;  
PAffineDblVector = ^TAffineDblVector;  
TAffineDblVector = array[0..2] of Double;  
TVector3d = TAffineDblVector;  
PAffineExtVector = ^TAffineExtVector;  
TAffineExtVector = array[0..2] of Extended;  
TVector3e = TAffineExtVector;  
PAffinePtrVector = ^TAffinePtrVector;  
TAffinePtrVector = array[0..2] of Pointer;  
TVector3p = TAffinePtrVector;  
PVector = ^TVector;  
TVector = THomogeneousFltVector;  
PHomogeneousVector = ^THomogeneousVector;  
THomogeneousVector = THomogeneousFltVector;  
PAffineVector = ^TAffineVector;  
TAffineVector = TAffineFltVector;  
PVectorArray = ^TVectorArray;  
TVectorArray = array[0..0] of TAffineVector;  
THomogeneousByteMatrix = array[0..3] of THomogeneousByteVector;  
TMatrix4b = THomogeneousByteMatrix;  
THomogeneousWordMatrix = array[0..3] of THomogeneousWordVector;  
TMatrix4w = THomogeneousWordMatrix;  
THomogeneousIntMatrix = array[0..3] of THomogeneousIntVector;  
TMatrix4i = THomogeneousIntMatrix;  
THomogeneousFltMatrix = array[0..3] of THomogeneousFltVector;  
TMatrix4f = THomogeneousFltMatrix;  
THomogeneousDblMatrix = array[0..3] of THomogeneousDblVector;  
TMatrix4d = THomogeneousDblMatrix;  
THomogeneousExtMatrix = array[0..3] of THomogeneousExtVector;  
TMatrix4e = THomogeneousExtMatrix;  
TAffineByteMatrix = array[0..2] of TAffineByteVector;  
TMatrix3b = TAffineByteMatrix;  
TAffineWordMatrix = array[0..2] of TAffineWordVector;  
TMatrix3w = TAffineWordMatrix;  
TAffineIntMatrix = array[0..2] of TAffineIntVector;  
TMatrix3i = TAffineIntMatrix;  
TAffineFltMatrix = array[0..2] of TAffineFltVector;  
TMatrix3f = TAffineFltMatrix;  
TAffineDblMatrix = array[0..2] of TAffineDblVector;  
TMatrix3d = TAffineDblMatrix;  
TAffineExtMatrix = array[0..2] of TAffineExtVector;  
TMatrix3e = TAffineExtMatrix;  
PMatrix = ^TMatrix;  
TMatrix = THomogeneousFltMatrix;  
PHomogeneousMatrix = ^THomogeneousMatrix;  
THomogeneousMatrix = THomogeneousFltMatrix;  
PAffineMatrix = ^TAffineMatrix;  
TAffineMatrix = TAffineFltMatrix;  
TTransType  
  • ttScaleX:
  • ttScaleY:
  • ttScaleZ:
  • ttShearXY:
  • ttShearXZ:
  • ttShearYZ:
  • ttRotateX:
  • ttRotateY:
  • ttRotateZ:
  • ttTranslateX:
  • ttTranslateY:
  • ttTranslateZ:
  • ttPerspectiveX:
  • ttPerspectiveY:
  • ttPerspectiveZ:
  • ttPerspectiveW:
TTransformations = array[TTransType] of Single;  

Constants

NameDescription
XVector: TAffineVector = (1, 0, 0);  
YVector: TAffineVector = (0, 1, 0);  
ZVector: TAffineVector = (0, 0, 1);  
NullVector: TAffineVector = (0, 0, 0);  
IdentityMatrix: TMatrix = ((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1));  
EmptyMatrix: TMatrix = ((0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0));  
EPSILON = 1e-100;  
EPSILON2 = 1e-50;  

Generated by PasDoc 0.8.8 on 2005-01-20 19:01:20