File: SVVector3d.mesa
Last edited by Bier on June 26, 1984 11:50:06 am PDT
Contents: Vector addition and multiplication and stuff like that.
DIRECTORY
SV3d,
SVVector2d;
SVVector3d: DEFINITIONS =
BEGIN
Point3d: TYPE = SV3d.Point3d;
Vector: TYPE = SV3d.Vector;
Vector2d: TYPE = SVVector2d.Vector2d;
Add: PROC [v1: Vector, v2: Vector] RETURNS [sumV: Vector];
Sub: 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];
ElementwiseProduct: PROC [v1: Vector, v2: Vector] RETURNS [prod: Vector];
CrossProduct: PROC [v1: Vector, v2: Vector] RETURNS [prodV: Vector];
Magnitude: PROC [v: Vector] RETURNS [magnitude: REAL];
Distance: PROC [p1, p2: Point3d] RETURNS [dist: REAL];
MagnitudeSquared: PROC [v: Vector] RETURNS [magSquared: REAL];
DistanceSquared: PROC [p1, p2: Point3d] RETURNS [distSquared: REAL];
VectorFromPoints: PROC [tail, head: Point3d] RETURNS [vector: Vector];
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.