Numerical and symbolic geometry.
This file contains functions for analytic geometry in the plane. There are numerical Euler functions, and symbolic Maxima functions.
Load this file with "load geometry". See the example notebook for this package.
defaultd:=textheight()*1.5;
function plotLabel (text:string, p:real vector, .. v:real vector=[1,1], d:number=defaultd)
Plot a label at position p Plot a label to a screen position with offset vector v (normalized, default is lower right) and distance d (in screen units)
function plotPoint (p:real vector, name:string="default", ..
Plot a point [with a name] Plot a point at position x See:
plotLabel (Geometry in Euler)
function plotSegment (A:real vector, B:real vector, .. name:string="default", d:number=defaultd)
Plot a segment from A to B d is the distance of the label
function plotLine (g:real vector, name:string="default", .. d:number=defaultd)
Plot a line through A to B d is the distance of the label
function turn (v:real vector, phi:number)
Turn a vector with angle phi
function turnLeft (v:real vector)
Turn a vector orthogonally to the left
function turnRight (v:real vector)
Turn a vector orthogonally to the right
function lineThrough (A:real vector, B:real vector)
Compute a line through A and B returns [a,b,c] s.t. ax+by=c is an equation of the line.
function lineWithDirection (A:real vector, v:real vector)
lineWithDirection(A,v) compute a line through A into direction v. See:
lineThrough (Geometry in Euler)
function getLineDirection (g:real vector)
Returns a direction vector of the line.
function getNormal (g:real vector)
Return a perpendicular vector on g
function getPointOnLine (g:real vector)
Return a point on the line.
function perpendicular (A:real vector, g:real vector)
Compute a perpendicular line through A to g See:
lineThrough (Geometry in Euler),
parallel (Geometry in Euler)
function parallel (A:real vector, g:real vector)
Compute a parallel line through A to g See:
perpendicular (Geometry in Euler)
function lineIntersection (g:real vector, h:real vector)
Compute the intersection of two lines
function projectToLine (A:real vector, g:real vector)
Project a point to a line.
function areaTriangle (A:real vector, B:real vector, C:real vector)
Compute the area of the triangle A,B,C
function computeAngle (A:real vector, B:real vector, C:real vector)
Compute the angle at B.
function setPlotRange (a:number, b=none, c:number=0, d:number=0)
Set the plot range setPlotRange(r) sets the range to a rectangle around (0,0).
function circleWithCenter (A:real vector, r:number)
Return a circle around A with radius r.
function getCircleCenter (c:real vector)
Return the center of a circle.
function getCircleRadius (c:real vector)
Return the radius of a circle.
function middlePerpendicular (A:real vector, B:real vector)
Return the middle perpendicular of AB.
function circleThrough (A,B,C)
Compute a circle through three points.
function plotCircle (c,name="default",v=[1,-1],d=defaultd)
Plot a circle. The label will attach to the circle in direction v (default is lower right).
function angleBisector (A:real vector, B:real vector, C:real vector)
Compute the middle perpendicular of the angle ABC
function distance (A:real vector, B:real vector)
Compute the distance of two points. See:
norm (Linear Algebra),
norm (Geometry in Euler)
function distanceSquared (A:real vector, B:real vector)
Compute the distance of two points, squared.
function quadrance (A:real vector, B:real vector)
Compute the distance of two points, squared.
function lineCircleIntersections (l:real vector, c:real vector)
Intersection a line with a circle. Return both intersection points, and the number of intersections.
function circleCircleIntersections (c1:real vector, c2:real vector)
Intersection of two circles. Return both intersection points, and the number of intersections.
function normalize (v:real vector)
Return the normalized vector v.
function crossProduct (v:real vector, w:real vector)
Compute the cross product of v and w.
function planeThrough (A:real vector, B:real vector, C:real vector)
Compute a plane through three points.
maximafunction norm (x)
The norm of a point x=[a,b]
maximafunction normalize (x)
The normalized vector x/norm(x)
maximafunction scalp (a,b)
The scalar product a*b
maximafunction distance (A,B)
The distance of the points A and B
maximafunction distanceSquared (A,B)
The distance of the points A and B squared See:
quad (Geometry in Euler)
maximafunction turnRight (v)
The vector v turned 90� to the right
maximafunction turnLeft (v)
The vector v turned 90� to the left
maximafunction lineThrough (A,B)
The line through A and B in the form [a,b,c] with equation ax+bx=c
maximafunction getLineEquation (line,x,y)
Equation of the line with variables x,y
maximafunction getHesseForm (line,x,y,A)
Hesseform of the line with the point A on the positive side.
maximafunction getLineDirection (line)
Direction vector of the line
maximafunction perpendicular (A,line)
Perpendicular line through A.
maximafunction parallel (line)
Parallel line through A.
maximafunction lineIntersection (g,h)
Intersection point of the two lines.
maximafunction projectToLine (A,line)
Orthogonal projection of A to the line.
maximafunction areaTriangle (A,B,C)
Area of the triangle.
maximafunction computeAngle (A,B,C)
Angle with corner at A.
maximafunction circleWithCenter (A,r)
Circle around A with radius r.
maximafunction circleThrough (A,B,C)
Circle through three points.
maximafunction getCircleCenter (circle)
Center of the circle.
maximafunction getCircleRadius (circle)
Radius of the circle.
maximafunction angleBisector (A,B,C)
Angle bisector for angle with corner at B.
maximafunction quad (A,B)
Distance AB squared
maximafunction spread (a,b,c)
Spread of the of the triangle a,b,c. The spread is sin(alpha)^2. alpha is opposite to a.
maximafunction crosslaw (a,b,c,sa)
Equation for three quads and one spread in a triangle. The spread is sa=sin(alpha)^2. alpha is opposite to a.
maximafunction triplespread (sa,sb,sc)
Equation for three spreads sa,sb,sc forming a triangle. The spreads are sin(phi)^2 for each angle.
maximafunction doublespread (sa)
Spread of the doubled angle. Spread of 2*phi, if sa=sin(phi)^2 is the spread of a.
The following definitions are sent to Maxima in direct mode when the file is loaded.