Unit BasicFunctions

DescriptionusesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Unit containing general procedures and functions.

uses

Functions and Procedures

Overview

procedure CrossProduct(const a, b: TVector; var Res: TVector);
function DistanceXY(const X1, Y1, X2, Y2: real): real;
function DotProduct(const a, b: TVector): real;
procedure Normalize(var v: TVector);
procedure PlaneRotationZ(const X, Y, Angle: real; var Xnew, Ynew: real);
function Sgn(r: real): integer;

Description

procedure CrossProduct(const a, b: TVector; var Res: TVector);

Procedure for calculating the cross product between two vectors.

parameters
a
is a 3D vector.
b
is a 3D vector.
returns

The 3D vector Res containing the resulting cross product a x b.

function DistanceXY(const X1, Y1, X2, Y2: real): real;

Calculates the distance between the points (X1,Y1) and (X2,Y2).

function DotProduct(const a, b: TVector): real;

Calculates the dot product between the two 3D-vectors a and b.

procedure Normalize(var v: TVector);

Normalizes the 3D-vector v. If the vector (v) has a length near zero, the null-vector is returned.

procedure PlaneRotationZ(const X, Y, Angle: real; var Xnew, Ynew: real);

Rotates the point (X,Y) by an angle (Angle) around the Z-axis. Angle should be given in radians.

returns

The new location of the point as (Xnew,Ynew).

function Sgn(r: real): integer;

Returns the sign of the supplied argument.

returns

-1 if the value is less than zero and 1 otherwise.


Generated by PasDoc 0.8.8.3 on 2005-05-28 08:13:49