DEFINITIONS FOR SHALOSH B. EKHAD, XIV's PLANE GEOMETRY TEXT
Cover
Foreword
Introduction
Theorems
#Def (The perpendicular to line Le1 that passes through point Pt1
Altitude:=proc(Pt1,Le1): expand(coeff(expand(Le1),x,1)*(y-Pt1[2])-
coeff(expand(Le1),y,1)*(x-Pt1[1])): end:
#The triangle whose medial triangle is DEF
AntiMedial:=proc(D,E,F) local A,B,C,eq,var:eq:={D[1]=(A[1]+B[1])/2,D[2]=
(A[2]+B[2])/2,E[1]=(A[1]+C[1])/2,E[2]=(A[2]+C[2])/2,F[1]=(B[1]+C[1])/2,F[2]=
(B[2]+C[2])/2}:var:={A[1],B[1],C[1],A[2],B[2],C[2]}: var:=solve(eq,var):
subs(var,[A[1],A[2]]),subs(var,[B[1],B[2]]),subs(var,[C[1],C[2]]):end:
#Def(Area of triangle ABC)
AREA:=proc(A,B,C):normal(expand((B[1]*C[2]-B[2]*C[1]-A[1]*C[2]+A[2]*C[1]
-B[1]*A[2]+B[2]*A[1])/2)):end:
#Def The refl. of line L1 through line L2
Billiard:=proc(L1,L2) local gu,L1a,L2a,a,b,c,d,e,f:
L1a:=a*x+b*y+c:L2a:=d*x+e*y+f:gu:=BilliardSym(L1a,L2a):
subs({a=coeff(expand(L1),x,1),b=coeff(expand(L1),y,1),c=subs(y=0,subs(x=0,L1)),
d=coeff(expand(L2),x,1),e=coeff(expand(L2),y,1),f=subs(y=0,subs(x=0,L2))},gu):
end:
#Def (The refl. of gen. line L1 through gen. line L2)
BilliardSym:=proc(L1,L2) local P,m,n,sl:
m:=-coeff(L1,x,1)/coeff(L1,y,1):n:=-coeff(L2,x,1)/coeff(L2,y,1):
P:=Pt(L1,L2): sl:=TS(n,n,-m):numer(normal((y-P[2])-sl*(x-P[1]))):end:
#Def (The Circumcircle of the inputed Points)
Ce:=proc() local eq,a,b,c,i,q:eq:=x^2+y^2+a*x+b*y+c:q:=solve({seq(subs(
{x=args[i][1],y=args[i][2]},eq),i=1..nargs)} ,{a,b,c}):expand(subs(q,eq)):end:
#Def(The Center of a Conic)
Center:=proc(Conic):
subs(solve({diff(Conic,x),diff(Conic,y)},{x,y}),[x,y]):
end:
#Def (The intersection of the three medians)
Centroid:=proc(A,B,C):Concurrency(Le(MidPt(A,B),C),Le(MidPt(A,C),B),
Le(MidPt(B,C),A)):end:
#The centroid of the quadrilateral ABCD
CentroidQ:=proc(A,B,C,D) local P,Q,a,b:P:=Centroid(A,B,C):Q:=Centroid(A,C,D):
a:=AREA(A,B,C): b:=AREA(A,C,D):
[a/(a+b)*P[1]+b/(a+b)*Q[1],a/(a+b)*P[2]+b/(a+b)*Q[2]]:end:
#Def(Circumcenter of the equilateral triangle two of whose vertices are A and B)
CET:=proc(A,B):Circumcenter(A, B, [(B[1]+A[1])/2-(A[2]-B[2])*3^(1/2)/2,
B[2]/2+(A[1]-B[1])*3^(1/2)/2+A[2]/2]):end:
#Def(Do the circles C1,C2,C3, have a common point?)
CirclesHaveCommonPoint:=proc(C1,C2,C3) local P:
P:=subs(solve({expand(C1-C2),expand(C1-C3)},{x,y}),[x,y]):
ItIsZero(subs({x=P[1],y=P[2]},C1)) and
ItIsZero(subs({x=P[1],y=P[2]},C2)) and ItIsZero(subs({x=P[1],y=P[2]},C3)) :
end:
#Def (The Circumcenter of the triangle ABC)
Circumcenter:=proc(A,B,C):Center(Ce(A,B,C)):end:
#Def (Circumradius of the triangle ABC)
Circumradius:=proc(A,B,C):Radius(Ce(A,B,C)):end:
#Def (The inputed points all on the same line?)
Colinear:=proc() local i:
if nargs<2 then ERROR(`Need at least two Pts`): fi: for i from 3 to nargs do
if AREA(args[1],args[2],args[i])<>0 then RETURN(false):fi:od:true:end:
#Length of a common tangent to the circles centered C1(C2) with radius R1(R2)
ComTangLgtSq:=proc(C1,R1,C2,R2) local a,d:d:=sqrt(DeSq(C1,C2)):a:=d*R2/(R1-R2):
sqrt((d+a)^2-R1^2)-sqrt(a^2-R2^2):end:
#Def (Are the inputed points all on the same circle?)
Concyclic:=proc() local i,C1:C1:=Ce(args[1],args[2],args[3]):
for i from 4 to nargs do if not ItIsZero(C1-Ce(args[1],args[2],args[i])) then
RETURN(false): fi: od: true: end:
#Def (The common point of the inputed lines)
Concurrency:=proc() local q: q:=solve({args},{x,y}):[subs(q,x),subs(q,y)]: end:
#Def (Are the inputed lines concurrent?)
Concurrent:=proc(): not evalb(solve({args},{x,y})=NULL): end:
#Def (Are the inputed circles concurrent?)
ConcurrentCes:=proc() local p,i:
p:=subs(solve({seq(args[1]-args[i],i=2..nargs)},{x,y}),[x,y]):
for i from 1 to nargs do
if not PtLiesOnCurve(p,args[i]) then RETURN(false) fi: od:
true: end:
#Def (the conic(s) through the list of points PointList)
ConicThroughPoints:=proc(PointList)
local Conic,A,B,C,D,E,F,i:
Conic:=A*x^2+B*x*y+C*y^2+D*x+E*y+F:
subs(
solve({seq(subs({x=PointList[i][1],y=PointList[i][2]},Conic),
i=1..nops(PointList))},{A,B,C,D,E,F}),Conic):
end:
#Def (the distance between point A and point B) (use with caution)
De:=proc(A,B):sqrt(DeSq(A,B)):end:
#Def (Square of Distance of point P to line L)
DePtLeSq:=proc(P,L):DeSq(Pt(Altitude(P,L),L),P):end:
#Def (The square of the distance of points A and B)
DeSq:=proc(A,B):(A[1]-B[1])^2+(A[2]-B[2])^2: end:
#Def (The square of the distance of points A and B, in dim-dimensional space)
DeSqG:=proc(A,B,dim) local i :sum((A[i]-B[i])^2,i=1..dim): end:
#Def(Excircles of standard triangle Te(m,n)
Excircles:=proc(m,n) local C,T,a,b,c,gu,i: T:=Te(m,n):C:=x^2+y^2+a*x+b*y+c:
gu:=solve({TouchCeLe1(C,Le(T[1],T[2])),TouchCeLe1(C,Le(T[1],T[3])),
TouchCeLe1(C,Le(T[2],T[3]))},{a,b,c}):
{seq(subs(gu[i],C),i=1..nops([gu]))} minus {Incircle(m,n)}:end:
#Def (The line through Circumcenter, Orthocenter, and Centroid)
EulerLine:=proc(A,B,C):Le(Orthocenter(A,B,C),Circumcenter(A,B,C)):end:
#Def (Projection of point Pt1 on line Le1)
Ft:=proc(Pt1,Le1) :Pt(Altitude(Pt1,Le1),Le1):end:
#Def (Gergonne Point of Standard Triangle Te(m,n))
GergonnePt:=proc(m,n) local T,C1:T:=Te(m,n):C1:=Incircle(m,n):
Pt(Le(T[1],PtLeCe(Le(T[2],T[3]),C1)),Le(T[2],PtLeCe(Le(T[1],T[3]),C1))):end:
#Def(The incenter of the triangle whose vertices are A(0,0), B(1,0),
#and the slopes of AB and BC are TS(m,m),TS(n,n),resp.)
Incenter:=proc(m,n) local C: C:=Te(m,n)[3]: if m=n then [1/2,m/2] :else
Concurrency(y-m*x,y+n*x-n,y-C[2]-expand((x-C[1])*TS(m,1/n))) fi:end:
#Def: The eq. of the incircle through the standard triangle
Incircle:=proc(m,n) local C,R:R:=Inradius(m,n):C:=Incenter(m,n):
expand((x-C[1])^2+(y-C[2])^2-R^2):end:
#Def(The inradius of the standard triangle )
Inradius:=proc(m,n) local A,B,C,T,O:
T:=Te(m,n):A:=T[1]:B:=T[2]:C:=T[3]:O:=Incenter(m,n):sqrt(normal(
{DePtLeSq(O,Le(A,B)),DePtLeSq(O,Le(A,C)),DePtLeSq(O,Le(B,C))})[1]):end:
#Def(Is the triangle ABC equilateral?)
ItIsEquilateral:=proc(A,B,C):evalb(normal
({DeSq(A,B)-DeSq(A,C),DeSq(B,C)-DeSq(C,A)})={0}):end:
#Def(Are the points Q,T,S,R vertices of a parallogram?)
ItIsParallelogram:=proc(Q,T,S,R):
evalb(ItIsZero(Slope(Q,T)-Slope(S,R)) and ItIsZero(Slope(T,S)-Slope(R,Q))):
end:
#Def(Are the points Q,T,S,R vertices of a square?)
ItIsSquare:=proc(Q,T,S,R)
evalb(
ItIsZero(DeSq(Q,T)-DeSq(T,S)) and ItIsZero(DeSq(Q,T)-DeSq(Q,R)) and
ItIsZero(DeSq(Q,T)-DeSq(R,S)) and ItIsZero(Slope(Q,R)*Slope(Q,T)+1)):
end:
#Def(Is it zero?)
ItIsZero:=proc(a):evalb(normal(a)=0):end:
#Kiss(Pt1,Pt2,Ce1): The point P, that lies on Ce1, and such that
#the Circle through Pt1,Pt2,P touches Ce1 at P
Kiss:=proc(Pt1,Pt2,Ce1) local x1,y1,gu1,gu2,lu,Pt3:
gu1:=Tangent(Ce1,[x1,y1]):gu2:=Tangent(Ce(Pt1,Pt2,[x1,y1]),[x1,y1]):
lu:=solve({subs({x=x1,y=y1},Ce1),coeff(gu2,x,1)*coeff(gu1,y,1)-
coeff(gu1,x,1)*coeff(gu2,y,1)},{x1,y1}): Pt3:=subs(lu[1],[x1,y1]):
if not Colinear(Pt1,Pt2,Pt3) then RETURN(Pt3): else
RETURN(subs(lu[2],[x1,y1])): fi: end:
#Def (The eq. of the line joining A and B)
Le:=proc(A,B) AREA(A,B,[x,y]):end:
#MDOS(A,B): The point where the diagonals of the Outside Square on AB meet
MDOS:=proc(A,B) local a,b: a:=B[1]-A[1]:b:=B[2]-A[2]:
Pt(Le(A,[A[1]+a+b,A[2]+b-a]),Le(B,[A[1]+b,A[2]-a])):end:
#Def (The midpoint between A and B)
MidPt:=proc(A,B):[(A[1]+B[1])/2,(A[2]+B[2])/2]:end:
#Def (Mirror reflection of line l1 w.r.t. line l
MirRefLeLe:=proc(l1,l) local O,P: O:=Pt(l,l1):P:=[1/3,solve(subs(x=1/3,l1),y)]:
Le(O,MirRefPtLe(P,l)):end:
#Def (Mirror reflection of the origin w.r.t. to the line AB)
MirRefOf0:=proc(A,B) local q: q:=Ft([0,0],Le(A,B)): [2*q[1],2*q[2]]:end:
#Def (Mirror reflection of the point P w.r.t. to the line l)
MirRefPtLe:=proc(P,l) local q:
q:=Ft([0,0],subs({x=x+P[1],y=y+P[2]},l)): [2*q[1]+P[1],2*q[2]+P[2]]:end:
#Def (the reflection of the point P1 w.r.t. the point P2
MirRefPtPt:=proc(P1,P2): normal([P2[1]-(P1[1]-P2[1]),P2[2]-(P1[2]-P2[2])]):end:
#Def(Nagel Point of the standard triangle Te(m,n))
NagelPt:=proc(m,n) local T:T:=Te(m,n):Pt(Le(T[1],PtLeCe(Le(T[2],T[3]),
Incircle(m,-1/n))),Le(T[2],PtLeCe(Le(T[1],T[3]),Incircle(-1/m,n)))):end:
#Def (Euler's Nine-point circle for triangle ABC)
NinePointCircle:=proc(A,B,C): Ce(MidPt(A,B),MidPt(A,C),MidPt(B,C)):end:
#Def(Normal to the parametric ellipse at the parametric point
NormalToEllipse:=proc(c,d,t) local P: P:=ParEllipse(c,d,t):
diff(P[2],t)*(y-P[2])+diff(P[1],t)*(x-P[1]):end:
#Def (The intersection of the three perpendicular projections)
Orthocenter:=proc(A,B,C):Concurrency(Altitude(A,Le(B,C)),Altitude(B,Le(A,C)),
Altitude(C,Le(A,B))):end:
#OtherCeCe(C1,C2,P): The other meeting Pt of two circles C1,C2 meet at the P
OtherCeCe:=proc(C1,C2,P) if normal(subs({x=P[1],y=P[2]},C1))<>0 or
normal(subs({x=P[1],y=P[2]},C2))<>0 then ERROR(`The circles do not meet at`, P)
: fi: MirRefPtLe(P,Le(Center(C1),Center(C2))):end:
#Def (Generic point on a Parametric circle center [c[1],c[2]] and radius R)
ParamCircle:=proc(c,R,t):[c[1]+R*(t+1/t)/2,c[2]+R*(t-1/t)/2/I]:end:
#Def (Generic point on a parametric line)
ParamLine:=proc(m,b,t):[t,m*t+b]:end:
#Def (Generic point on a Parametric ellipse, center [c[1],c[2]])
ParEllipse:=proc(c,d,t):[c[1]+d[1]*(t+1/t)/2,c[2]+d[2]*(t-1/t)/2/I]:end:
#Parametric Point on the Perpendicular Bisector of AB
ParPtPerBisect:=proc(A,B,s)local M:M:=MidPt(A,B):[M[1]+s,M[2]-s/Slope(A,B)]:end:
#The Pedal Triangle of the Triangle ABC w.r.t to pt P
Pedal:=proc(A,B,C,P) Ft(P,Le(A,B)),Ft(P,Le(A,C)),Ft(P,Le(B,C)): end:
#Def(Line through Midpoint of PQ perpendicular to PQ)
PerpMid:=proc(P,Q):PerpPQ(P,MidPt(P,Q)):end:
#Def(Line through Q perpendicular to PQ)
PerpPQ:=proc(P,Q):expand((y-Q[2])*(P[2]-Q[2])+(x-Q[1])*(P[1]-Q[1])):end:
#Def(Point between A and B that is the `p-point')
pmidpt:=proc(A,B,p): normal([A[1]+p*(B[1]-A[1]),A[2]+p*(B[2]-A[2])]):end:
#Def( Power of pt Pt w.r.t. circle with Center C and radius R)
Powe:=proc(C,R,Pt):DeSq(C,Pt)-R^2:end:
#Def (The point of intersection of lines Le1 and Le2)
Pt:=proc(Le1,Le2) local q:q:=solve(
{numer(normal(Le1)),numer(normal(Le2))},{x,y}):
[normal(simplify(subs(q,x))),normal(simplify(subs(q,y)))]:end:
#Def(The common point of a circle and a line that touches it)
PtLeCe:=proc(L1,C1):subs(solve({L1,C1},{x,y}),[x,y]):end:
#Def(PtLiesOnCurve(P1,C1), returns true iff point P1 lies on curve C1)
PtLiesOnCurve:=proc(P1,C1):ItIsZero(subs({x=P1[1],y=P1[2]},C1)):end:
#Def(Quadrilateral through four lines L1,L2,L3,L4)
Quad:=proc(L1,L2,L3,L4):Pt(L1,L2),Pt(L2,L3),Pt(L3,L4),Pt(L4,L1):end:
#Def (the radical center of circles with centers (radiii) C1,C2,C3,R1,R2,R3
RadicalCenter:=proc(C1,R1,C2,R2,C3,R3) local C,R:
Pt(RadicalLine(C1,R1,C2,R2),RadicalLine(C1,R1,C3,R3)):end:
#Def( Radical line of circles with Centers C1,C2 and Radii R1, R2
RadicalLine:=proc(C1,R1,C2,R2):expand(Powe(C1,R1,[x,y])-Powe(C2,R2,[x,y])):
end:
#Def(The Radius of a circle Circ)
Radius:=proc(Circ) local q:
q:=Center(Circ):sqrt(normal(subs({x=q[1],y=q[2]},-Circ))):end:
#Def (The slope of the line joining points A and B)
Slope:=proc(A,B):normal((B[2]-A[2])/(B[1]-A[1])):end:
#Def( Is it true that sqrt(a)+sqrt(b)=sqrt(c) ?)
Sqabc:=proc(a,b,c):ItIsZero((c-a-b)^2-4*a*b):end:
#SSR(A,n,B): the polynomial in A[1], ..., A[n], B
#whose vanishing is equivalent to B equaling the sum
#of the square roots of A[1],..., A[n]
SSR:=proc(A,n,B) local gu,x,i,d:if n=1 then RETURN(B^2-A[1]): fi:gu:=
expand(subs(B=B-x,SSR(A,n-1,B))):d:=degree(gu,x)/2:expand(sum(coeff(gu,x,2*i)*
A[n]^i,i=0..d)^2-A[n]*sum(coeff(gu,x,2*i+1)*A[n]^i,i=0..d)^2):end:
#SSR1(A,B): given a list A returns true if B is the sum
#(of one of the possibilities of sums of square roots of
#the elements of A
SSR1:=proc(A,B) local gu,i,j,mu,lu: gu:={0}:
for i from 1 to nops(A) do mu:={}: lu:=simplify(sqrt(A[i])):
for j from 1 to nops(gu) do mu:=mu union {gu[j]+lu,gu[j]-lu}: od:gu:=mu:od:
for i from 1 to nops(gu) do if
expand(simplify(simplify(expand(gu[i]^2-B^2),symbolic)))=
0 then
RETURN(true):fi:od:false:end:
#Tangent(Ce1,Pt1): Given a circle Ce1, and a point Pt1
#on it, finds the equation of the tangent
Tangent:=proc(Ce1,Pt1) local A,x0,y0: A:=coeff(Ce1,x,2):x0:=Pt1[1]: y0:=Pt1[2]:
numer(normal((y-y0)*(2*A*y0+coeff(Ce1,y,1))+(x-x0)*(2*A*x0+coeff(Ce1,x,1)))):
end:
#Def(Tangent to the parametric ellipse at the parametric point
TangentToEllipse:=proc(c,d,t) local P: P:=ParEllipse(c,d,t):
diff(P[1],t)*(y-P[2])-(x-P[1])*diff(P[2],t):end:
#CommonTangentsMeetPt(C1,R1,b,d,R2): Intersection of common Tangents of Circle1
#with center C1 and radius R1 and Cirlce2 with center C2,distance d from C1
#such that the angle betwen C1C2 and the x-axis is b radians
CommonTangentsMeetPt:=proc(C1,R1,b,d,R2) local a:
a:=d/(R2/R1-1):normal(expand([C1[1]-a*cos(b),C1[2]-a*sin(b)])):end:
#Def: The condition that two circles, with given centers and radii touch
TcCesOut:=
proc(C1,R1,C2,R2):expand((R1+R2)^2-(C1[1]-C2[1])^2-(C1[2]-C2[2])^2):end:
#Def(Standard Triangle whose vertices are A(0,0),B(1,0) and angles
#CAB and CBA are 2*arctan(m) and 2*arctan(-n) resp.
Te:=proc(m,n):[0,0],[1,0],Pt(y-TS(m,m)*x,y+TS(n,n)*(x-1)):end:
#Def(Given two circles C1,C2, decides whether they touch)
TouchCe:=proc(C1,C2) local gu: gu:=expand(subs(y=solve(C1-C2,y),C1)):
ItIsZero(4*coeff(gu,x,2)*coeff(gu,x,0)-coeff(gu,x,1)^2):
end:
#Def(The expression whose vanishing guarantess that the symbolic
#circles touch)
TouchCe1:=proc(C1,C2) local gu: gu:=expand(subs(y=solve(C1-C2,y),C1)):
numer(normal(4*coeff(gu,x,2)*coeff(gu,x,0)-coeff(gu,x,1)^2)):
end:
#Def(Given a circle C1, and a line L1, decides whether they touch)
TouchCeLe:=proc(C1,L1) local gu: gu:=expand(subs(y=solve(L1,y),C1)):
ItIsZero(4*coeff(gu,x,2)*coeff(gu,x,0)-coeff(gu,x,1)^2):
end:
#Def(The expression whose vanishing guarantess that the symbolic
#circle C1 and Line L1 touch)
TouchCeLe1:=proc(C1,L1) local gu: gu:=expand(subs(y=solve(L1,y),C1)):
numer(normal(4*coeff(gu,x,2)*coeff(gu,x,0)-coeff(gu,x,1)^2)):
end:
#Def:tan(a_1+a_2+...) expressed in terms li[1]:=tan(a_1), li[2]:=tan(a_2) ..
TS:=proc(li) local i,t:if nargs=1 then RETURN(args[1]) else
t:=TS(seq(args[i],i=2..nargs)): RETURN((args[1]+t)/(1-t*args[1])):fi:end:
Cover
Foreword
Introduction
Theorems