File: SVVector3d.mesa
Last edited by Bier on July 3, 1983 12:54 pm
Contents: Vector addition and multiplication and stuff like that.
DIRECTORY
SVVector2d;
SVVector3d: DEFINITIONS =
BEGIN
Vector: TYPE = ARRAY [1..3] OF REAL;
Vector2d: TYPE = SVVector2d.Vector2d;
Add: PROC [v1: Vector, v2: Vector] RETURNS [sumV: Vector];
Difference: PROC [v1: Vector, v2: Vector] RETURNS [v1Minusv2: Vector];
Scale: PROC [v: Vector, scalar: REAL] RETURNS [scaledV: Vector];
Normalize: PROC [v: Vector] RETURNS [normV: Vector];
Returns the unit vector with the same direction as v.
Negate: PROC [v: Vector] RETURNS [negV: Vector];
DotProduct: PROC [v1: Vector, v2: Vector] RETURNS [scalar: REAL];
CrossProduct: PROC [v1: Vector, v2: Vector] RETURNS [prodV: Vector];
Magnitude: PROC [v: Vector] RETURNS [magnitude: REAL];
Parallel: PROC [v1, v2: Vector] RETURNS [BOOL];
Perpendicular: PROC [v1, v2: Vector] RETURNS [BOOL];
Vector2DAsXYVector: PROC [vXY: Vector2d] RETURNS [vZeroZ: Vector];
Vector2DAsYZVector: PROC [vYZ: Vector2d] RETURNS [vZeroX: Vector];
Vector2DAsZXVector: PROC [vZX: Vector2d] RETURNS [vZeroY: Vector];
ProjectOntoXYPlane: PROC [v: Vector] RETURNS [v2d: Vector2d];
ProjectOntoYZPlane: PROC [v: Vector] RETURNS [v2d: Vector2d];
ProjectOntoZXPlane: PROC [v: Vector] RETURNS [v2d: Vector2d];
END.