Complexes.mesa
Last Edited by: Arnon, June 10, 1985 4:19:22 pm PDT
DIRECTORY
Rope,
Vector2 USING [VEC],
Basics,
IO,
AlgebraClasses;
Complexes: CEDAR DEFINITIONS
= BEGIN OPEN AC: AlgebraClasses;
Types and Variables
Complex: TYPE = AC.Object;
ComplexData: TYPE = REF Vector2.VEC;
Complexes: AC.Object;
Structure Operations
PrintName: AC.ToRopeOp;
ShortPrintName: AC.ToRopeOp;
Characteristic: AC.StructureRankOp;
I/O and Conversion
Recast: AC.BinaryOp;
CanRecast: AC.BinaryPredicate;
LegalFirstChar: AC.LegalFirstCharOp;
Read: AC.ReadOp;
FromRope: AC.FromRopeOp;
ToRope: AC.ToRopeOp;
Write: AC.WriteOp;
FromPairREAL: PROC [realPart, imagPart: REAL] RETURNS [Complex];
ToPairREAL: PROC [in: Complex] RETURNS [realPart, imagPart: REAL];
Arithmetic
Zero: AC.NullaryOp;
One: AC.NullaryOp;
Add: AC.BinaryOp;
Negate: AC.UnaryOp;
Subtract: AC.BinaryOp;
Multiply: AC.BinaryOp;
Conjugate: AC.UnaryOp;
ModulusSquared: PROCEDURE [a: Complex] RETURNS [REAL];
Modulus: AC.UnaryOp;
Power: AC.BinaryOp;
Invert: AC.UnaryOp;
Divide: AC.BinaryOp;
AlmostEqual: PROCEDURE [a: Complex, b: Complex, mag:[-126..0] ← -20] RETURNS [BOOLEAN];
FromPolar: PROCEDURE [r: REAL, radians: REAL] RETURNS [Complex];
Arg: PROCEDURE [a: Complex] RETURNS [REAL];
returns the angle from the x axis to a, in radians.
Exp: PROCEDURE [a: Complex] RETURNS [Complex];
complex exponential function
Ln: PROCEDURE [a: Complex] RETURNS [Complex];
complex natural logarithm
Sqr: PROCEDURE [a: Complex] RETURNS [Complex]; -- like Mul[a,a]
SqRt: PROCEDURE [a: Complex] RETURNS [Complex]; -- complex square root
Comparison
Equal: AC.BinaryPredicate;
END.