Common Lisp Package: PH-MATHS-2D

README:

FUNCTION

Public

<> (V1 V2)

returns the scalar product <v1, v2>

ABS-ANGLE (PHI)

returns a positive angle 0 <= phi <= 2pi

CARTESIAN-COORDS (V-POLAR)

returns a cartesian representation of polar vector v-polar

DISTANCE-POINT-LINE (POINT P1 P2)

returns the shortest distance from point to the line p1,p2.

INTERSECT-LINE-CIRCLE (P1 P2 R)

returns the intersection of a line through p1 and p2 and a circle around p2 with radius r

P (V1 V2)

returns the projection of v1 onto v2. Second return value is the length of the projection.

POINT-IN-BOX-P (P P1 P2 &KEY (TOL 0))

returns true if p is inside the box given by p1,p2

POLAR-ANGLE (V)

return angle of cartesian vector v

POLAR-COORDS (V)

return a polar representation of cartesian vector v

POLAR-RADIUS (V)

return radius of cartesian vector v

TO-DECIMAL (VAL &KEY (BASE 16))

converts val (a value in base base as a string) to an integer

TO-RGB (HTML-COLOR)

parses an html color code like #A204B2 to '(.8 .01 .7 4)

TO-RGB-VECTOR (HTML-COLOR)

parses an html color code like #A204B2 to #(.8 .01 .7 4)

V0 (V)

returns a vector with the same direction as v and unit length

VP (V)

returns a unit vector perpendicular to v

Undocumented

DEG->RAD (DEGS)

MAX-ABS (&REST VALS)

MIN-ABS (&REST VALS)

PHI (V)

R (V)

RAD->DEG (RADS)

V (X Y)

V* (LAMBDA VECTOR)

V+ (&REST VECTORS)

V- (&REST VECTORS)

V-POLAR (PHI R)

X (V)

Y (V)

~= (&REST PARAMS)

Private

Undocumented

ABS-REDUCE (FN VALS)

DENIL (LST)

V-REDUCE (FN VECTORS)