12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390 |
- Thu Jan 28 23:37:50 MET 1999
- REDUCE 3.7, 15-Jan-99 ...
- 1: 1:
- 2: 2: 2: 2: 2: 2: 2: 2: 2:
- Geometry 1.1 Last update Sept 6, 1998
- 3: 3: % Author H.-G. Graebe | Univ. Leipzig | Version 6.9.1998
- % graebe@informatik.uni-leipzig.de
- comment
- Test suite for the package GEOMETRY 1.1
- end comment;
- algebraic;
- load cali,geometry;
- off nat;
- on echo;
- showtime;
- Time: 190 ms
- % #####################
- % Some one line proofs
- % #####################
- % A generic triangle ABC
- A:=Point(a1,a2);
- a := {a1,a2}$
- B:=Point(b1,b2);
- b := {b1,b2}$
- C:=Point(c1,c2);
- c := {c1,c2}$
- % Its midpoint perpendiculars have a point in common:
- concurrent(mp(a,b),mp(b,c),mp(c,a));
- 0$
-
- % This point
- M:=intersection_point(mp(a,b),mp(b,c));
- m := {(a1**2*b2 - a1**2*c2 + a2**2*b2 - a2**2*c2 - a2*b1**2 - a2*b2**2 + a2*c1**
- 2 + a2*c2**2 + b1**2*c2 + b2**2*c2 - b2*c1**2 - b2*c2**2)/(2*(a1*b2 - a1*c2 - a2
- *b1 + a2*c1 + b1*c2 - b2*c1)),
- ( - a1**2*b1 + a1**2*c1 + a1*b1**2 + a1*b2**2 - a1*c1**2 - a1*c2**2 - a2**2*b1 +
- a2**2*c1 - b1**2*c1 + b1*c1**2 + b1*c2**2 - b2**2*c1)/(2*(a1*b2 - a1*c2 - a2*b1
- + a2*c1 + b1*c2 - b2*c1))}$
- % is the center of the circumscribed circle
- sqrdist(M,A) - sqrdist(M,B);
- 0$
-
- % The altitutes intersection theorem
- concurrent(altitude(a,b,c),altitude(b,c,a),altitude(c,a,b));
- 0$
- % The median intersection theorem
- concurrent(median(a,b,c),median(b,c,a),median(c,a,b));
- 0$
- % Euler's line
- M:=intersection_point(mp(a,b),mp(b,c));
- m := {(a1**2*b2 - a1**2*c2 + a2**2*b2 - a2**2*c2 - a2*b1**2 - a2*b2**2 + a2*c1**
- 2 + a2*c2**2 + b1**2*c2 + b2**2*c2 - b2*c1**2 - b2*c2**2)/(2*(a1*b2 - a1*c2 - a2
- *b1 + a2*c1 + b1*c2 - b2*c1)),
- ( - a1**2*b1 + a1**2*c1 + a1*b1**2 + a1*b2**2 - a1*c1**2 - a1*c2**2 - a2**2*b1 +
- a2**2*c1 - b1**2*c1 + b1*c1**2 + b1*c2**2 - b2**2*c1)/(2*(a1*b2 - a1*c2 - a2*b1
- + a2*c1 + b1*c2 - b2*c1))}$
- H:=intersection_point(altitude(a,b,c),altitude(b,c,a));
- h := {( - a1*a2*b1 + a1*a2*c1 + a1*b1*b2 - a1*c1*c2 - a2**2*b2 + a2**2*c2 + a2*
- b2**2 - a2*c2**2 - b1*b2*c1 + b1*c1*c2 - b2**2*c2 + b2*c2**2)/(a1*b2 - a1*c2 -
- a2*b1 + a2*c1 + b1*c2 - b2*c1),
- (a1**2*b1 - a1**2*c1 + a1*a2*b2 - a1*a2*c2 - a1*b1**2 + a1*c1**2 - a2*b1*b2 + a2
- *c1*c2 + b1**2*c1 + b1*b2*c2 - b1*c1**2 - b2*c1*c2)/(a1*b2 - a1*c2 - a2*b1 + a2*
- c1 + b1*c2 - b2*c1)}$
- S:=intersection_point(median(a,b,c),median(b,c,a));
- s := {(a1 + b1 + c1)/3,(a2 + b2 + c2)/3}$
- collinear(M,H,S);
- 0$
- sqrdist(S,varpoint(M,H,2/3));
- 0$
- % Feuerbach's circle
- % Choose a special coordinate system
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(u1,0);
- b := {u1,0}$
- C:=Point(u2,u3);
- c := {u2,u3}$
- M:=intersection_point(mp(a,b),mp(b,c));
- m := {u1/2,( - u1*u2 + u2**2 + u3**2)/(2*u3)}$
- H:=intersection_point(altitude(a,b,c),altitude(b,c,a));
- h := {u2,(u2*(u1 - u2))/u3}$
- N:=midpoint(M,H);
- n := {(u1 + 2*u2)/4,(u1*u2 - u2**2 + u3**2)/(4*u3)}$
- sqrdist(N,midpoint(A,B))-sqrdist(N,midpoint(B,C));
- 0$
- sqrdist(N,midpoint(A,B))-sqrdist(N,midpoint(H,C));
- 0$
- D:=intersection_point(pp_line(A,B),pp_line(H,C));
- d := {u2,0}$
- sqrdist(N,midpoint(A,B))-sqrdist(N,D);
- 0$
- clear_ndg();
- {}$
- clear(A,B,C,D,M,H,S,N);
- % #############################
- % Non-linear Geometric Objects
- % #############################
- % Bisector intersection theorem
-
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(1,0);
- b := {1,0}$
- C:=Point(u1,u2);
- c := {u1,u2}$
- P:=Point(x1,x2);
- p := {x1,x2}$
-
- polys:={
- point_on_bisector(P,A,B,C),
- point_on_bisector(P,B,C,A),
- point_on_bisector(P,C,A,B)};
- polys := { - 2*u1*x1*x2 + 2*u1*x2 + u2*x1**2 - 2*u2*x1 - u2*x2**2 + u2 + 2*x1*x2
- - 2*x2,
- - 2*u1**3*x2 + 2*u1**2*u2*x1 - u1**2*u2 + 2*u1**2*x1*x2 + 2*u1**2*x2 - 2*u1*u2
- **2*x2 - 2*u1*u2*x1**2 + 2*u1*u2*x2**2 - 2*u1*x1*x2 + 2*u2**3*x1 - u2**3 - 2*u2
- **2*x1*x2 + 2*u2**2*x2 + u2*x1**2 - u2*x2**2,
- 2*u1*x1*x2 - u2*x1**2 + u2*x2**2}$
- con1:=num(sqrdist(P,pedalpoint(p,pp_line(A,C)))-x2^2);
- con1 := u2*( - 2*u1**3*x1*x2 + u1**2*u2*x1**2 - u1**2*u2*x2**2 - 2*u1*u2**2*x1*
- x2 + u2**3*x1**2 - u2**3*x2**2)$
- con2:=num(sqrdist(p,pedalpoint(p,pp_line(B,C)))-x2^2);
- con2 := u2*( - 2*u1**3*x1*x2 + 2*u1**3*x2 + u1**2*u2*x1**2 - 2*u1**2*u2*x1 - u1
- **2*u2*x2**2 + u1**2*u2 + 6*u1**2*x1*x2 - 6*u1**2*x2 - 2*u1*u2**2*x1*x2 + 2*u1*
- u2**2*x2 - 2*u1*u2*x1**2 + 4*u1*u2*x1 + 2*u1*u2*x2**2 - 2*u1*u2 - 6*u1*x1*x2 + 6
- *u1*x2 + u2**3*x1**2 - 2*u2**3*x1 - u2**3*x2**2 + u2**3 + 2*u2**2*x1*x2 - 2*u2**
- 2*x2 + u2*x1**2 - 2*u2*x1 - u2*x2**2 + u2 + 2*x1*x2 - 2*x2)$
- setring({x1,x2},{},lex);
- {{x1,x2},{},lex,{1,1}}$
- setideal(polys,polys);
- {u2*x1**2 - (2*u1 - 2)*x1*x2 - (2*u2)*x1 - u2*x2**2 + (2*u1 - 2)*x2 + u2,
- - (2*u1*u2 - u2)*x1**2 + (2*u1**2 - 2*u1 - 2*u2**2)*x1*x2 + (2*u1**2*u2 + 2*u2
- **3)*x1 + (2*u1*u2 - u2)*x2**2 - (2*u1**3 - 2*u1**2 + 2*u1*u2**2 - 2*u2**2)*x2 -
- (u1**2*u2 + u2**3),
- - u2*x1**2 + (2*u1)*x1*x2 + u2*x2**2}$
- gbasis polys;
- {(4*u2)*x2**4 - (8*u1**2 - 8*u1 + 8*u2**2)*x2**3 + (4*u1**2*u2 - 4*u1*u2 + 4*u2
- **3 - 4*u2)*x2**2 + (4*u2**2)*x2 - u2**3,
- (2*u1*u2**2 - u2**2)*x1 + (2*u2)*x2**3 - (4*u1**2 - 4*u1 + 2*u2**2)*x2**2 - (2*
- u1**2*u2 - 2*u1*u2 + 2*u2)*x2 - (u1*u2**2 - u2**2)}$
- {con1,con2} mod gbasis polys;
- {0,0}$
- % Bisector intersection theorem. A constructive proof.
-
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(1,0);
- b := {1,0}$
- P:=Point(u1,u2);
- p := {u1,u2}$
- l1:=pp_line(A,B);
- l1 := {0,-1,0}$
- l2:=symline(l1,pp_line(A,P));
- l2 := { - 2*u1*u2,u1**2 - u2**2,0}$
- l3:=symline(l1,pp_line(B,P));
- l3 := {2*u2*( - u1 + 1),
- u1**2 - 2*u1 - u2**2 + 1,
- 2*u2*(u1 - 1)}$
- point_on_bisector(P,A,B,intersection_point(l2,l3));
- 0$
- clear_ndg();
- {}$
- clear(A,B,C,P,l1,l2,l3);
- % Miquel's theorem
- on gcd;
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(1,0);
- b := {1,0}$
- C:=Point(c1,c2);
- c := {c1,c2}$
- P:=choose_pl(pp_line(A,B),u1);
- p := {u1,0}$
- Q:=choose_pl(pp_line(B,C),u2);
- q := {u2,(c2*(u2 - 1))/(c1 - 1)}$
- R:=choose_pl(pp_line(A,C),u3);
- r := {u3,(c2*u3)/c1}$
- X:=other_cc_point(P,p3_circle(A,P,R),p3_circle(B,P,Q))$
- point_on_circle(X,p3_circle(C,Q,R));
- 0$
- off gcd;
- clear_ndg();
- {}$
- clear(A,B,C,P,Q,R,X);
- % ########################
- % Theorems of linear type
- % ########################
- % Pappus' theorem
- A:=Point(u1,u2);
- a := {u1,u2}$
- B:=Point(u3,u4);
- b := {u3,u4}$
- C:=Point(x1,u5);
- c := {x1,u5}$
-
- P:=Point(u6,u7);
- p := {u6,u7}$
- Q:=Point(u8,u9);
- q := {u8,u9}$
- R:=Point(u0,x2);
- r := {u0,x2}$
- polys:={collinear(A,B,C), collinear(P,Q,R)};
- polys := {u1*u4 - u1*u5 - u2*u3 + u2*x1 + u3*u5 - u4*x1,
- u0*u7 - u0*u9 + u6*u9 - u6*x2 - u7*u8 + u8*x2}$
- con:=collinear(
- intersection_point(pp_line(A,Q),pp_line(P,B)),
- intersection_point(pp_line(A,R),pp_line(P,C)),
- intersection_point(pp_line(B,R),pp_line(Q,C)))$
- vars:={x1,x2};
- vars := {x1,x2}$
- sol:=solve(polys,vars);
- sol := {{x1=( - u1*u4 + u1*u5 + u2*u3 - u3*u5)/(u2 - u4),
- x2=(u0*u7 - u0*u9 + u6*u9 - u7*u8)/(u6 - u8)}}$
- sub(sol,con);
- 0$
- % Pappus' theorem. A constructive approach
- A:=Point(u1,u2);
- a := {u1,u2}$
- B:=Point(u3,u4);
- b := {u3,u4}$
-
- P:=Point(u6,u7);
- p := {u6,u7}$
- Q:=Point(u8,u9);
- q := {u8,u9}$
-
- C:=choose_pl(pp_line(A,B),u5);
- c := {u5,
- (u1*u4 - u2*u3 + u2*u5 - u4*u5)/(u1 - u3)}$
- R:=choose_pl(pp_line(P,Q),u0);
- r := {u0,
- (u0*u7 - u0*u9 + u6*u9 - u7*u8)/(u6 - u8)}$
- con:=collinear(intersection_point(pp_line(A,Q),pp_line(P,B)),
- intersection_point(pp_line(A,R),pp_line(P,C)),
- intersection_point(pp_line(B,R),pp_line(Q,C)));
- con := 0$
- clear_ndg();
- {}$
- clear(A,B,C,P,Q,R);
- % ###########################
- % Theorems of non linear type
- % ###########################
- % Fermat Point
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(0,2);
- b := {0,2}$
- C:=Point(u1,u2);
- c := {u1,u2}$
- P:=Point(x1,x2);
- p := {x1,x2}$
- Q:=Point(x3,x4);
- q := {x3,x4}$
- R:=Point(x5,x6);
- r := {x5,x6}$
- polys1:={sqrdist(P,B)-sqrdist(B,C), sqrdist(P,C)-sqrdist(B,C),
- sqrdist(Q,A)-sqrdist(A,C), sqrdist(Q,C)-sqrdist(A,C),
- sqrdist(R,B)-sqrdist(A,B), sqrdist(R,A)-sqrdist(A,B)};
- polys1 := { - u1**2 - u2**2 + 4*u2 + x1**2 + x2**2 - 4*x2,
- - 2*u1*x1 - 2*u2*x2 + 4*u2 + x1**2 + x2**2 - 4,
- - u1**2 - u2**2 + x3**2 + x4**2,
- - 2*u1*x3 - 2*u2*x4 + x3**2 + x4**2,
- x5**2 + x6**2 - 4*x6,
- x5**2 + x6**2 - 4}$
- con:=concurrent(pp_line(A,P), pp_line(B,Q), pp_line(C,R));
- con := - u1*x1*x4*x6 + 2*u1*x1*x6 + u1*x2*x3*x6 - 2*u1*x2*x3 + 2*u2*x1*x3 + u2*
- x1*x4*x5 - 2*u2*x1*x5 - u2*x2*x3*x5 - 2*x1*x3*x6 + 2*x2*x3*x5$
- vars:={x1,x2,x3,x4,x5,x6};
- vars := {x1,
- x2,
- x3,
- x4,
- x5,
- x6}$
- setring(vars,{},lex);
- {{x1,x2,x3,x4,x5,x6},{},lex,{1,1,1,1,1,1}}$
- iso:=isolatedprimes polys1;
- iso := {{x5**2 - 3,
- x6 - 1,
- u1*x5 - u2 + 2*x4,
- - u1*x5 - u2 + 2*x2 - 2,
- - u1 - u2*x5 + 2*x3,
- - u1 + u2*x5 + 2*x1 - 2*x5},
- {x5**2 - 3,
- x6 - 1,
- - u1*x5 - u2 + 2*x4,
- u1*x5 - u2 + 2*x2 - 2,
- - u1 + u2*x5 + 2*x3,
- - u1 - u2*x5 + 2*x1 + 2*x5},
- {x5**2 - 3,
- x6 - 1,
- u1*x5 - u2 + 2*x4,
- u1*x5 - u2 + 2*x2 - 2,
- - u1 - u2*x5 + 2*x3,
- - u1 - u2*x5 + 2*x1 + 2*x5},
- {x5**2 - 3,
- x6 - 1,
- - u1*x5 - u2 + 2*x4,
- - u1*x5 - u2 + 2*x2 - 2,
- - u1 + u2*x5 + 2*x3,
- - u1 + u2*x5 + 2*x1 - 2*x5}}$
- for each u in iso collect con mod u;
- { - 3*u1**2*u2 + 3*u1**2 - 2*u1*u2*x5 + 2*u1*x5 - 3*u2**3 + 9*u2**2 - 6*u2,
- 0,
- (u1**3*x5 + 3*u1**2*u2 - 6*u1**2 + u1*u2**2*x5 - 4*u1*u2*x5 + 3*u2**3 - 18*u2**2
- + 24*u2)/2,
- ( - u1**3*x5 + 3*u1**2*u2 - u1*u2**2*x5 + 4*u1*x5 + 3*u2**3 - 12*u2)/2}$
- polys2:={sqrdist(P,B)-sqrdist(P,C),
- sqrdist(Q,A)-sqrdist(Q,C),
- sqrdist(R,A)-sqrdist(R,B),
- num(p3_angle(R,A,B)-p3_angle(P,B,C)),
- num(p3_angle(Q,C,A)-p3_angle(P,B,C))};
- polys2 := { - u1**2 + 2*u1*x1 - u2**2 + 2*u2*x2 - 4*x2 + 4,
- - u1**2 + 2*u1*x3 - u2**2 + 2*u2*x4,
- 4*(x6 - 1),
- - u1*x1*x5 - u1*x2*x6 + 2*u1*x6 + u2*x1*x6 - u2*x2*x5 + 2*u2*x5 - 2*x1*x6 + 2*
- x2*x5 - 4*x5,
- u1**3*x2 - 2*u1**3 - u1**2*u2*x1 + u1**2*x1*x4 + 2*u1**2*x1 - u1**2*x2*x3 + 2*u1
- **2*x3 + u1*u2**2*x2 - 2*u1*u2**2 - 2*u1*x1*x3 - 2*u1*x2*x4 + 4*u1*x4 - u2**3*x1
- + u2**2*x1*x4 + 2*u2**2*x1 - u2**2*x2*x3 + 2*u2**2*x3 - 2*u2*x1*x4 + 2*u2*x2*x3
- - 4*u2*x3}$
- sol:=solve(polys2,{x1,x2,x3,x4,x6});
- sol := {{x2=( - u1*x5 + u2 + 2)/2,
- x4=(u1*x5 + u2)/2,
- x1=(u1 + u2*x5 - 2*x5)/2,
- x3=(u1 - u2*x5)/2,
- x6=1}}$
- sub(sol,con);
- 0$
- clear_ndg();
- {}$
- clear(A,B,C,P,Q,R);
- % ####################
- % Desargue's theorem
- % ####################
- % A constructive proof.
- A:=Point(a1,a2);
- a := {a1,a2}$
- B:=Point(b1,b2);
- b := {b1,b2}$
-
- C:=Point(c1,c2);
- c := {c1,c2}$
- R:=Point(d1,d2);
- r := {d1,d2}$
- S:=choose_pl(par(R,pp_line(A,B)),u);
- s := {u,
- (a1*d2 - a2*d1 + a2*u - b1*d2 + b2*d1 - b2*u)/(a1 - b1)}$
- T:=intersection_point(par(R,pp_line(A,C)),par(S,pp_line(B,C)));
- t := {(a1*u - b1*d1 + c1*d1 - c1*u)/(a1 - b1),
- (a1*d2 - a2*d1 + a2*u - b1*d2 + c2*d1 - c2*u)/(a1 - b1)}$
-
- con:=concurrent(pp_line(A,R),pp_line(B,S),pp_line(C,T));
- con := 0$
- % Desargue's theorem as theorem of linear type.
- A:=Point(u1,u2);
- a := {u1,u2}$
- B:=Point(u3,u4);
- b := {u3,u4}$
- C:=Point(u5,u6);
- c := {u5,u6}$
- R:=Point(u7,u8);
- r := {u7,u8}$
- S:=Point(u9,x1);
- s := {u9,x1}$
- T:=Point(x2,x3);
- t := {x2,x3}$
- polys:={parallel(pp_line(R,S),pp_line(A,B)),
- parallel(pp_line(S,T),pp_line(B,C)),
- parallel(pp_line(R,T),pp_line(A,C))};
- polys := { - u1*u8 + u1*x1 + u2*u7 - u2*u9 + u3*u8 - u3*x1 - u4*u7 + u4*u9,
- - u3*x1 + u3*x3 + u4*u9 - u4*x2 + u5*x1 - u5*x3 - u6*u9 + u6*x2,
- - u1*u8 + u1*x3 + u2*u7 - u2*x2 + u5*u8 - u5*x3 - u6*u7 + u6*x2}$
- con:=concurrent(pp_line(A,R),pp_line(B,S),pp_line(C,T));
- con := - u1*u3*u6*u8 + u1*u3*u6*x1 + u1*u3*u8*x3 - u1*u3*x1*x3 + u1*u4*u5*u8 -
- u1*u4*u5*x3 - u1*u4*u6*u9 + u1*u4*u6*x2 - u1*u4*u8*x2 + u1*u4*u9*x3 - u1*u5*u8*
- x1 + u1*u5*x1*x3 + u1*u6*u8*u9 - u1*u6*x1*x2 - u1*u8*u9*x3 + u1*u8*x1*x2 - u2*u3
- *u5*x1 + u2*u3*u5*x3 + u2*u3*u6*u7 - u2*u3*u6*x2 - u2*u3*u7*x3 + u2*u3*x1*x2 -
- u2*u4*u5*u7 + u2*u4*u5*u9 + u2*u4*u7*x2 - u2*u4*u9*x2 + u2*u5*u7*x1 - u2*u5*u9*
- x3 - u2*u6*u7*u9 + u2*u6*u9*x2 + u2*u7*u9*x3 - u2*u7*x1*x2 + u3*u5*u8*x1 - u3*u5
- *u8*x3 - u3*u6*u7*x1 + u3*u6*u8*x2 + u3*u7*x1*x3 - u3*u8*x1*x2 + u4*u5*u7*x3 -
- u4*u5*u8*u9 + u4*u6*u7*u9 - u4*u6*u7*x2 - u4*u7*u9*x3 + u4*u8*u9*x2 - u5*u7*x1*
- x3 + u5*u8*u9*x3 + u6*u7*x1*x2 - u6*u8*u9*x2$
- sol:=solve(polys,{x1,x2,x3});
- sol := {{x1=(u1*u8 - u2*u7 + u2*u9 - u3*u8 + u4*u7 - u4*u9)/(u1 - u3),
- x2=(u1*u9 - u3*u7 + u5*u7 - u5*u9)/(u1 - u3),
- x3=(u1*u8 - u2*u7 + u2*u9 - u3*u8 + u6*u7 - u6*u9)/(u1 - u3)}}$
- sub(sol,con);
- 0$
- % The general theorem of Desargue.
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(0,1);
- b := {0,1}$
- C:=Point(u5,u6);
- c := {u5,u6}$
- R:=Point(u7,u8);
- r := {u7,u8}$
- S:=Point(u9,u1);
- s := {u9,u1}$
- T:=Point(u2,x1);
- t := {u2,x1}$
- con1:=collinear(intersection_point(pp_line(R,S),pp_line(A,B)),
- intersection_point(pp_line(S,T),pp_line(B,C)),
- intersection_point(pp_line(R,T),pp_line(A,C)));
- con1 := (u5*( - u1**2*u2**2*u6*u7 + u1**2*u2*u5*u7*x1 + u1**2*u2*u6*u7**2 - u1**
- 2*u5*u7**2*x1 + u1*u2**2*u6*u7*u8 + u1*u2**2*u6*u7 + u1*u2**2*u6*u8*u9 - u1*u2**
- 2*u8*u9 - u1*u2*u5*u7*u8*x1 - u1*u2*u5*u7*x1 - u1*u2*u5*u8*u9*x1 + u1*u2*u5*u8*
- u9 - u1*u2*u6*u7**2*x1 - u1*u2*u6*u7**2 - 2*u1*u2*u6*u7*u8*u9 + u1*u2*u6*u7*u9*
- x1 - u1*u2*u6*u7*u9 + u1*u2*u7*u8*u9 + u1*u2*u7*u9*x1 + u1*u5*u7**2*x1**2 + u1*
- u5*u7**2*x1 + 2*u1*u5*u7*u8*u9*x1 - u1*u5*u7*u8*u9 - u1*u5*u7*u9*x1**2 + u1*u6*
- u7**2*u9 - u1*u7**2*u9*x1 - u2**2*u6*u7*u8 - u2**2*u6*u8**2*u9 + u2**2*u8**2*u9
- + u2*u5*u7*u8*x1 + u2*u5*u8**2*u9*x1 - u2*u5*u8**2*u9 + u2*u6*u7**2*x1 + u2*u6*
- u7*u8*u9*x1 + 2*u2*u6*u7*u8*u9 - u2*u6*u7*u9*x1 + u2*u6*u8**2*u9**2 - u2*u6*u8*
- u9**2*x1 - 2*u2*u7*u8*u9*x1 - u2*u8**2*u9**2 + u2*u8*u9**2*x1 - u5*u7**2*x1**2 -
- u5*u7*u8*u9*x1**2 + u5*u7*u9*x1**2 - u5*u8**2*u9**2*x1 + u5*u8**2*u9**2 + u5*u8
- *u9**2*x1**2 - u5*u8*u9**2*x1 - u6*u7**2*u9*x1 - u6*u7*u8*u9**2 + u6*u7*u9**2*x1
- + u7**2*u9*x1**2 + u7*u8*u9**2*x1 - u7*u9**2*x1**2))/(u1*u2*u5*u6*u7 - u1*u2*u5
- *u6*u9 + u1*u5**2*u7*u8 - u1*u5**2*u7*x1 - u1*u5**2*u8*u9 + u1*u5**2*u9*x1 - u1*
- u5*u6*u7**2 + u1*u5*u6*u7*u9 + u2**2*u6**2*u7 - u2**2*u6**2*u9 - u2**2*u6*u7 +
- u2**2*u6*u9 + u2*u5*u6*u7*u8 - 2*u2*u5*u6*u7*x1 - u2*u5*u6*u8*u9 + 2*u2*u5*u6*u9
- *x1 - u2*u5*u7*u8 + u2*u5*u7*x1 + u2*u5*u8*u9 - u2*u5*u9*x1 - u2*u6**2*u7**2 +
- u2*u6**2*u9**2 + u2*u6*u7**2 - u2*u6*u9**2 - u5**2*u7*u8*x1 + u5**2*u7*x1**2 +
- u5**2*u8*u9*x1 - u5**2*u9*x1**2 + u5*u6*u7**2*x1 - u5*u6*u7*u8*u9 + u5*u6*u8*u9
- **2 - u5*u6*u9**2*x1 + u5*u7*u8*u9 - u5*u7*u9*x1 - u5*u8*u9**2 + u5*u9**2*x1 +
- u6**2*u7**2*u9 - u6**2*u7*u9**2 - u6*u7**2*u9 + u6*u7*u9**2)$
- con2:=concurrent(pp_line(A,R),pp_line(B,S),pp_line(C,T));
- con2 := u1*u2*u6*u7 - u1*u5*u7*x1 - u2*u6*u7 - u2*u6*u8*u9 + u2*u8*u9 + u5*u7*x1
- + u5*u8*u9*x1 - u5*u8*u9 + u6*u7*u9 - u7*u9*x1$
- sol:=solve(con2,x1);
- sol := {x1=(u1*u2*u6*u7 - u2*u6*u7 - u2*u6*u8*u9 + u2*u8*u9 - u5*u8*u9 + u6*u7*
- u9)/(u1*u5*u7 - u5*u7 - u5*u8*u9 + u7*u9)}$
- sub(sol,con1);
- 0$
- clear_ndg();
- {}$
- clear(A,B,C,R,S,T);
- % #################
- % Brocard points
- % #################
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(1,0);
- b := {1,0}$
- C:=Point(u1,u2);
- c := {u1,u2}$
- c1:=Circle(1,x1,x2,x3);
- c1 := {1,x1,x2,x3}$
- c2:=Circle(1,x4,x5,x6);
- c2 := {1,x4,x5,x6}$
- c3:=Circle(1,x7,x8,x9);
- c3 := {1,x7,x8,x9}$
- polys:={
- cl_tangent(c1,pp_line(A,C)),
- point_on_circle(A,c1),
- point_on_circle(B,c1),
- cl_tangent(c2,pp_line(A,B)),
- point_on_circle(B,c2),
- point_on_circle(C,c2),
- cl_tangent(c3,pp_line(B,C)),
- point_on_circle(A,c3),
- point_on_circle(C,c3)};
- polys := {u1**2*x1**2 - 4*u1**2*x3 + 2*u1*u2*x1*x2 + u2**2*x2**2 - 4*u2**2*x3,
- x3,
- x1 + x3 + 1,
- x4**2 - 4*x6,
- x4 + x6 + 1,
- u1**2 + u1*x4 + u2**2 + u2*x5 + x6,
- u1**2*x7**2 - 4*u1**2*x9 + 2*u1*u2*x7*x8 + 4*u1*u2*x8 - 2*u1*x7**2 + 8*u1*x9 - 4
- *u2**2*x7 + u2**2*x8**2 - 4*u2**2*x9 - 4*u2**2 - 2*u2*x7*x8 - 4*u2*x8 + x7**2 -
- 4*x9,
- x9,
- u1**2 + u1*x7 + u2**2 + u2*x8 + x9}$
-
- vars:={x1,x2,x3,x4,x5,x6,x7,x8,x9};
- vars := {x1,
- x2,
- x3,
- x4,
- x5,
- x6,
- x7,
- x8,
- x9}$
- sol:=solve(polys,vars);
- sol := {{x6=1,
- x8=( - u1**3 + u1**2 - u1*u2**2 - u2**2)/u2,
- x2=u1/u2,
- x1=-1,
- x3=0,
- x4=-2,
- x5=( - u1**2 + 2*u1 - u2**2 - 1)/u2,
- x7=u1**2 - 2*u1 + u2**2,
- x9=0}}$
- P:=other_cc_point(B,sub(sol,c1),sub(sol,c2));
- p := {(u1**3 - u1**2 + u1*u2**2 + u1 + u2**2)/(u1**4 - 2*u1**3 + 2*u1**2*u2**2 +
- 3*u1**2 - 2*u1*u2**2 - 2*u1 + u2**4 + 3*u2**2 + 1),
- (u2*(u1**2 - 2*u1 + u2**2 + 1))/(u1**4 - 2*u1**3 + 2*u1**2*u2**2 + 3*u1**2 - 2*
- u1*u2**2 - 2*u1 + u2**4 + 3*u2**2 + 1)}$
- con:=point_on_circle(P,sub(sol,c3));
- con := 0$
- clear_ndg();
- {}$
- clear A,B,C,c1,c2,c3;
-
- % ##################
- % Simson's theorem
- % ##################
- % A constructive proof
- M:=Point(0,0);
- m := {0,0}$
- A:=choose_pc(M,r,u1);
- a := {(r*(u1**2 - 1))/(u1**2 + 1),(2*r*u1)/(u1**2 + 1)}$
- B:=choose_pc(M,r,u2);
- b := {(r*(u2**2 - 1))/(u2**2 + 1),(2*r*u2)/(u2**2 + 1)}$
- C:=choose_pc(M,r,u3);
- c := {(r*(u3**2 - 1))/(u3**2 + 1),(2*r*u3)/(u3**2 + 1)}$
- P:=choose_pc(M,r,u4);
- p := {(r*(u4**2 - 1))/(u4**2 + 1),(2*r*u4)/(u4**2 + 1)}$
- X:=pedalpoint(P,pp_line(A,B))$
- Y:=pedalpoint(P,pp_line(B,C))$
- Z:=pedalpoint(P,pp_line(A,C))$
-
- collinear(X,Y,Z);
- 0$
- clear_ndg();
- {}$
- clear(M,A,B,C,P,X,Y,Z);
- % Simson's theorem almost constructive
- clear_ndg();
- {}$
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(u1,u2);
- b := {u1,u2}$
-
- C:=Point(u3,u4);
- c := {u3,u4}$
- P:=Point(u5,x1);
- p := {u5,x1}$
- X:=pedalpoint(P,pp_line(A,B));
- x := {(u1*(u1*u5 + u2*x1))/(u1**2 + u2**2),
- (u2*(u1*u5 + u2*x1))/(u1**2 + u2**2)}$
- Y:=pedalpoint(P,pp_line(B,C));
- y := {(u1**2*u5 - u1*u2*u4 + u1*u2*x1 - 2*u1*u3*u5 + u1*u4**2 - u1*u4*x1 + u2**2
- *u3 - u2*u3*u4 - u2*u3*x1 + u3**2*u5 + u3*u4*x1)/(u1**2 - 2*u1*u3 + u2**2 - 2*u2
- *u4 + u3**2 + u4**2),
- (u1**2*u4 - u1*u2*u3 + u1*u2*u5 - u1*u3*u4 - u1*u4*u5 + u2**2*x1 + u2*u3**2 - u2
- *u3*u5 - 2*u2*u4*x1 + u3*u4*u5 + u4**2*x1)/(u1**2 - 2*u1*u3 + u2**2 - 2*u2*u4 +
- u3**2 + u4**2)}$
- Z:=pedalpoint(P,pp_line(A,C));
- z := {(u3*(u3*u5 + u4*x1))/(u3**2 + u4**2),
- (u4*(u3*u5 + u4*x1))/(u3**2 + u4**2)}$
- poly:=p4_circle(A,B,C,P);
- poly := u1**2*u3*x1 - u1**2*u4*u5 - u1*u3**2*x1 - u1*u4**2*x1 + u1*u4*u5**2 + u1
- *u4*x1**2 + u2**2*u3*x1 - u2**2*u4*u5 + u2*u3**2*u5 - u2*u3*u5**2 - u2*u3*x1**2
- + u2*u4**2*u5$
-
- con:=collinear(X,Y,Z);
- con := ( - u1**4*u3*u4**2*x1 + u1**4*u4**3*u5 + 2*u1**3*u2*u3**2*u4*x1 - 2*u1**3
- *u2*u3*u4**2*u5 + u1**3*u3**2*u4**2*x1 + u1**3*u4**4*x1 - u1**3*u4**3*u5**2 - u1
- **3*u4**3*x1**2 - u1**2*u2**2*u3**3*x1 + u1**2*u2**2*u3**2*u4*u5 - u1**2*u2**2*
- u3*u4**2*x1 + u1**2*u2**2*u4**3*u5 - 2*u1**2*u2*u3**3*u4*x1 - u1**2*u2*u3**2*u4
- **2*u5 - 2*u1**2*u2*u3*u4**3*x1 + 3*u1**2*u2*u3*u4**2*u5**2 + 3*u1**2*u2*u3*u4**
- 2*x1**2 - u1**2*u2*u4**4*u5 + 2*u1*u2**3*u3**2*u4*x1 - 2*u1*u2**3*u3*u4**2*u5 +
- u1*u2**2*u3**4*x1 + 2*u1*u2**2*u3**3*u4*u5 + u1*u2**2*u3**2*u4**2*x1 - 3*u1*u2**
- 2*u3**2*u4*u5**2 - 3*u1*u2**2*u3**2*u4*x1**2 + 2*u1*u2**2*u3*u4**3*u5 - u2**4*u3
- **3*x1 + u2**4*u3**2*u4*u5 - u2**3*u3**4*u5 + u2**3*u3**3*u5**2 + u2**3*u3**3*x1
- **2 - u2**3*u3**2*u4**2*u5)/(u1**4*u3**2 + u1**4*u4**2 - 2*u1**3*u3**3 - 2*u1**3
- *u3*u4**2 + 2*u1**2*u2**2*u3**2 + 2*u1**2*u2**2*u4**2 - 2*u1**2*u2*u3**2*u4 - 2*
- u1**2*u2*u4**3 + u1**2*u3**4 + 2*u1**2*u3**2*u4**2 + u1**2*u4**4 - 2*u1*u2**2*u3
- **3 - 2*u1*u2**2*u3*u4**2 + u2**4*u3**2 + u2**4*u4**2 - 2*u2**3*u3**2*u4 - 2*u2
- **3*u4**3 + u2**2*u3**4 + 2*u2**2*u3**2*u4**2 + u2**2*u4**4)$
- remainder(num con,poly);
- 0$
- print_ndg();
- {u3**2 + u4**2,
- u1**2 - 2*u1*u3 + u2**2 - 2*u2*u4 + u3**2 + u4**2,
- u1**2 + u2**2}$
- % Equational proof, first version:
- M:=Point(0,0);
- m := {0,0}$
- A:=Point(0,1);
- a := {0,1}$
-
- B:=Point(u1,x1);
- b := {u1,x1}$
- C:=Point(u2,x2);
- c := {u2,x2}$
- P:=Point(u3,x3);
- p := {u3,x3}$
- X:=varpoint(A,B,x4);
- x := {u1*( - x4 + 1), - x1*x4 + x1 + x4}$
- Y:=varpoint(B,C,x5);
- y := {u1*x5 - u2*x5 + u2,x1*x5 - x2*x5 + x2}$
- Z:=varpoint(A,C,x6);
- z := {u2*( - x6 + 1), - x2*x6 + x2 + x6}$
- polys:={sqrdist(M,B)-1, sqrdist(M,C)-1, sqrdist(M,P)-1,
- orthogonal(pp_line(A,B),pp_line(P,X)),
- orthogonal(pp_line(A,C),pp_line(P,Z)),
- orthogonal(pp_line(B,C),pp_line(P,Y))};
- polys := {u1**2 + x1**2 - 1,
- u2**2 + x2**2 - 1,
- u3**2 + x3**2 - 1,
- - u1**2*x4 + u1**2 - u1*u3 - x1**2*x4 + x1**2 - x1*x3 + 2*x1*x4 - x1 + x3 - x4,
- - u2**2*x6 + u2**2 - u2*u3 - x2**2*x6 + x2**2 - x2*x3 + 2*x2*x6 - x2 + x3 - x6,
- - u1**2*x5 + 2*u1*u2*x5 - u1*u2 + u1*u3 - u2**2*x5 + u2**2 - u2*u3 - x1**2*x5 +
- 2*x1*x2*x5 - x1*x2 + x1*x3 - x2**2*x5 + x2**2 - x2*x3}$
- con:=collinear(X,Y,Z);
- con := u1*x2*x4*x5 - u1*x2*x4*x6 - u1*x2*x5*x6 + u1*x2*x6 - u1*x4*x5 + u1*x4*x6
- + u1*x5*x6 - u1*x6 - u2*x1*x4*x5 + u2*x1*x4*x6 + u2*x1*x5*x6 - u2*x1*x6 + u2*x4*
- x5 - u2*x4*x6 - u2*x5*x6 + u2*x6$
- vars:={x4,x5,x6,x1,x2,x3};
- vars := {x4,
- x5,
- x6,
- x1,
- x2,
- x3}$
- setring(vars,{},lex);
- {{x4,x5,x6,x1,x2,x3},{},lex,{1,1,1,1,1,1}}$
- setideal(polys,polys);
- {x1**2 + (u1**2 - 1),
- x2**2 + (u2**2 - 1),
- x3**2 + (u3**2 - 1),
- - x4*x1**2 + 2*x4*x1 - (u1**2 + 1)*x4 + x1**2 - x1*x3 - x1 + x3 + (u1**2 - u1*
- u3),
- - x6*x2**2 + 2*x6*x2 - (u2**2 + 1)*x6 + x2**2 - x2*x3 - x2 + x3 + (u2**2 - u2*
- u3),
- - x5*x1**2 + 2*x5*x1*x2 - x5*x2**2 - (u1**2 - 2*u1*u2 + u2**2)*x5 - x1*x2 + x1*
- x3 + x2**2 - x2*x3 - (u1*u2 - u1*u3 - u2**2 + u2*u3)}$
- con mod gbasis polys;
- 0$
- % Second version:
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(1,0);
- b := {1,0}$
- C:=Point(u1,u2);
- c := {u1,u2}$
- P:=Point(u3,x1);
- p := {u3,x1}$
- X:=Point(x2,0);
- x := {x2,0}$
- % => on the line AB
- Y:=varpoint(B,C,x3);
- y := { - u1*x3 + u1 + x3,u2*( - x3 + 1)}$
- Z:=varpoint(A,C,x4);
- z := {u1*( - x4 + 1),u2*( - x4 + 1)}$
- polys:={orthogonal(pp_line(A,C),pp_line(P,Z)),
- orthogonal(pp_line(B,C),pp_line(P,Y)),
- orthogonal(pp_line(A,B),pp_line(P,X)),
- p4_circle(A,B,C,P)};
- polys := { - u1**2*x4 + u1**2 - u1*u3 - u2**2*x4 + u2**2 - u2*x1,
- - u1**2*x3 + u1**2 - u1*u3 + 2*u1*x3 - u1 - u2**2*x3 + u2**2 - u2*x1 + u3 - x3,
- - u3 + x2,
- - u1**2*x1 + u1*x1 - u2**2*x1 + u2*u3**2 - u2*u3 + u2*x1**2}$
- con:=collinear(X,Y,Z);
- con := u2*( - x2*x3 + x2*x4 - x3*x4 + x3)$
- vars:={x2,x3,x4,x1};
- vars := {x2,x3,x4,x1}$
- setring(vars,{},lex);
- {{x2,x3,x4,x1},{},lex,{1,1,1,1}}$
- con mod interreduce polys;
- 0$
- % The inverse theorem
- polys:={orthogonal(pp_line(A,C),pp_line(P,Z)),
- orthogonal(pp_line(B,C),pp_line(P,Y)),
- orthogonal(pp_line(A,B),pp_line(P,X)),
- collinear(X,Y,Z)};
- polys := { - u1**2*x4 + u1**2 - u1*u3 - u2**2*x4 + u2**2 - u2*x1,
- - u1**2*x3 + u1**2 - u1*u3 + 2*u1*x3 - u1 - u2**2*x3 + u2**2 - u2*x1 + u3 - x3,
- - u3 + x2,
- u2*( - x2*x3 + x2*x4 - x3*x4 + x3)}$
- con:=p4_circle(A,B,C,P);
- con := - u1**2*x1 + u1*x1 - u2**2*x1 + u2*u3**2 - u2*u3 + u2*x1**2$
- con mod interreduce polys;
- 0$
- clear_ndg();
- {}$
- clear(M,A,B,C,P,Y,Z);
- % ########################
- % The butterfly theorem
- % ########################
-
- % An equational proof with groebner factorizer and constraints.
- P:=Point(0,0);
- p := {0,0}$
- O:=Point(u1,0);
- o := {u1,0}$
- A:=Point(u2,u3);
- a := {u2,u3}$
-
- B:=Point(u4,x1);
- b := {u4,x1}$
- C:=Point(x2,x3);
- c := {x2,x3}$
-
- D:=Point(x4,x5);
- d := {x4,x5}$
-
- F:=Point(0,x6);
- f := {0,x6}$
- G:=Point(0,x7);
- g := {0,x7}$
- polys:={sqrdist(O,B)-sqrdist(O,A),
- sqrdist(O,C)-sqrdist(O,A),
- sqrdist(O,D)-sqrdist(O,A),
- point_on_line(P,pp_line(A,C)),
- point_on_line(P,pp_line(B,D)),
- point_on_line(F,pp_line(A,D)),
- point_on_line(G,pp_line(B,C))
- };
- polys := {2*u1*u2 - 2*u1*u4 - u2**2 - u3**2 + u4**2 + x1**2,
- 2*u1*u2 - 2*u1*x2 - u2**2 - u3**2 + x2**2 + x3**2,
- 2*u1*u2 - 2*u1*x4 - u2**2 - u3**2 + x4**2 + x5**2,
- - u2*x3 + u3*x2,
- - u4*x5 + x1*x4,
- - u2*x5 + u2*x6 + u3*x4 - x4*x6,
- - u4*x3 + u4*x7 + x1*x2 - x2*x7}$
- con:=num sqrdist(P,midpoint(F,G));
- con := x6**2 + 2*x6*x7 + x7**2$
- vars:={x6,x7,x3,x5,x1,x2,x4};
- vars := {x6,
- x7,
- x3,
- x5,
- x1,
- x2,
- x4}$
- setring(vars,{},lex);
- {{x6,x7,x3,x5,x1,x2,x4},{},lex,{1,1,1,1,1,1,1}}$
- sol:=groebfactor(polys,{sqrdist(A,C),sqrdist(B,D)});
- sol := {{x1**2 + (2*u1*u2 - 2*u1*u4 - u2**2 - u3**2 + u4**2),
- (u2**2 + u3**2)*x3 - (2*u1*u2*u3 - u2**2*u3 - u3**3),
- (2*u1*u2 - 2*u1*u4 - u2**2 - u3**2)*x5 + (2*u1*u2 - u2**2 - u3**2)*x1,
- (2*u1*u2 - 2*u1*u4 - u2**2 - u3**2)*x4 + (2*u1*u2*u4 - u2**2*u4 - u3**2*u4),
- (u2**2 + u3**2)*x2 - (2*u1*u2**2 - u2**3 - u2*u3**2),
- (2*u1*u2**2 - u2**3 - u2**2*u4 - u2*u3**2 - u3**2*u4)*x7 - (2*u1*u2**2 - u2**3 -
- u2*u3**2)*x1 + (2*u1*u2*u3*u4 - u2**2*u3*u4 - u3**3*u4),
- (2*u1*u2**2 - u2**3 - u2**2*u4 - u2*u3**2 - u3**2*u4)*x6 + (2*u1*u2**2 - u2**3 -
- u2*u3**2)*x1 - (2*u1*u2*u3*u4 - u2**2*u3*u4 - u3**3*u4)}}$
- for each u in sol collect con mod u;
- {0}$
- % A constructive proof
- on gcd;
- O:=Point(0,0);
- o := {0,0}$
- A:=Point(1,0);
- a := {1,0}$
-
- B:=choose_pc(O,1,u1);
- b := {(u1**2 - 1)/(u1**2 + 1),(2*u1)/(u1**2 + 1)}$
- C:=choose_pc(O,1,u2);
- c := {(u2**2 - 1)/(u2**2 + 1),(2*u2)/(u2**2 + 1)}$
- D:=choose_pc(O,1,u3);
- d := {(u3**2 - 1)/(u3**2 + 1),(2*u3)/(u3**2 + 1)}$
- P:=intersection_point(pp_line(A,C),pp_line(B,D));
- p := {(u1*u2 - u1*u3 + u2*u3 - 1)/(u1*u2 - u1*u3 + u2*u3 + 1),
- (2*u2)/(u1*u2 - u1*u3 + u2*u3 + 1)}$
- h:=lot(P,pp_line(O,P));
- h := {( - u1*u2 + u1*u3 - u2*u3 + 1)/(u1*u2 - u1*u3 + u2*u3 + 1),
- ( - 2*u2)/(u1*u2 - u1*u3 + u2*u3 + 1),
- (u1**2*u2**2 - 2*u1**2*u2*u3 + u1**2*u3**2 + 2*u1*u2**2*u3 - 2*u1*u2*u3**2 - 2*
- u1*u2 + 2*u1*u3 + u2**2*u3**2 + 4*u2**2 - 2*u2*u3 + 1)/(u1**2*u2**2 - 2*u1**2*u2
- *u3 + u1**2*u3**2 + 2*u1*u2**2*u3 - 2*u1*u2*u3**2 + 2*u1*u2 - 2*u1*u3 + u2**2*u3
- **2 + 2*u2*u3 + 1)}$
- F:=intersection_point(h,pp_line(A,D));
- f := {(u1**2*u2**2 - 2*u1**2*u2*u3 + u1**2*u3**2 - 2*u1*u2 + 2*u1*u3 - u2**2*u3
- **2 + 4*u2**2 - 4*u2*u3 + 1)/(u1**2*u2**2 - 2*u1**2*u2*u3 + u1**2*u3**2 - u2**2*
- u3**2 - 2*u2*u3 - 1),
- (2*u3*(u1*u2 - u1*u3 - 2*u2**2 + u2*u3 - 1))/(u1**2*u2**2 - 2*u1**2*u2*u3 + u1**
- 2*u3**2 - u2**2*u3**2 - 2*u2*u3 - 1)}$
-
- G:=intersection_point(h,pp_line(B,C));
- g := {(u1**2*u2**2 - 2*u1**2*u2*u3 + u1**2*u3**2 - 2*u1*u2 + 2*u1*u3 - u2**2*u3
- **2 - 4*u2**2 + 4*u2*u3 + 1)/(u1**2*u2**2 - 2*u1**2*u2*u3 + u1**2*u3**2 - u2**2*
- u3**2 - 2*u2*u3 - 1),
- (2*(2*u1*u2**2 - 3*u1*u2*u3 + u1*u3**2 - u2*u3**2 - 2*u2 + u3))/(u1**2*u2**2 - 2
- *u1**2*u2*u3 + u1**2*u3**2 - u2**2*u3**2 - 2*u2*u3 - 1)}$
- con:=sqrdist(P,midpoint(F,G));
- con := 0$
- off gcd;
- clear_ndg();
- {}$
- clear(O,A,B,C,D,P,h,F,G);
- % ################################
- % Tangency of Feuerbach's circle
- % ################################
-
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(2,0);
- b := {2,0}$
- C:=Point(u1,u2);
- c := {u1,u2}$
- M:=intersection_point(mp(A,B),mp(B,C));
- m := {1,(u1**2 - 2*u1 + u2**2)/(2*u2)}$
- H:=intersection_point(altitude(A,B,C),altitude(B,C,A));
- h := {u1,(u1*( - u1 + 2))/u2}$
- N:=midpoint(M,H);
- n := {(u1 + 1)/2,( - u1**2 + 2*u1 + u2**2)/(4*u2)}$
-
- c1:=c1_circle(N,sqrdist(N,midpoint(A,B)));
- c1 := {1, - (u1 + 1),(u1**2 - 2*u1 - u2**2)/(2*u2),u1}$
- % Feuerbach's circle
- P:=Point(x1,x2);
- p := {x1,x2}$
- % => x2 is the radius of the inscribed circle.
- polys:={point_on_bisector(P,A,B,C), point_on_bisector(P,B,C,A)};
- polys := {2*( - 2*u1*x1*x2 + 4*u1*x2 + u2*x1**2 - 4*u2*x1 - u2*x2**2 + 4*u2 + 4*
- x1*x2 - 8*x2),
- 2*( - u1**3*x2 + u1**2*u2*x1 - u1**2*u2 + u1**2*x1*x2 + 2*u1**2*x2 - u1*u2**2*x2
- - u1*u2*x1**2 + u1*u2*x2**2 - 2*u1*x1*x2 + u2**3*x1 - u2**3 - u2**2*x1*x2 + 2*
- u2**2*x2 + u2*x1**2 - u2*x2**2)}$
- con:=cc_tangent(c1_circle(P,x2^2),c1);
- con := (4*( - u1**3*x1*x2 + u1**3*x2 + u1**2*u2*x1**2 - 2*u1**2*u2*x1 - u1**2*u2
- *x2**2 + u1**2*u2 + u1**2*x1**2*x2 + u1**2*x1*x2 - 2*u1**2*x2 + u1*u2**2*x1*x2 -
- u1*u2**2*x2 - 2*u1*u2*x1**3 + 4*u1*u2*x1**2 - 2*u1*u2*x1 + 2*u1*u2*x2**2 - 2*u1
- *x1**2*x2 + 2*u1*x1*x2 - u2**2*x1**2*x2 + u2**2*x1*x2 + u2*x1**4 - 2*u2*x1**3 +
- u2*x1**2 - u2*x2**2))/u2$
-
- vars:={x1,x2};
- vars := {x1,x2}$
- setring(vars,{},lex);
- {{x1,x2},{},lex,{1,1}}$
- setideal(polys,polys);
- {(2*u2)*x1**2 - (4*u1 - 8)*x1*x2 - (8*u2)*x1 - (2*u2)*x2**2 + (8*u1 - 16)*x2 + 8
- *u2,
- - (2*u1*u2 - 2*u2)*x1**2 + (2*u1**2 - 4*u1 - 2*u2**2)*x1*x2 + (2*u1**2*u2 + 2*
- u2**3)*x1 + (2*u1*u2 - 2*u2)*x2**2 - (2*u1**3 - 4*u1**2 + 2*u1*u2**2 - 4*u2**2)*
- x2 - (2*u1**2*u2 + 2*u2**3)}$
- num con mod gbasis polys;
- 0$
- % Now let P be the incenter of the triangle ABH
- polys1:={point_on_bisector(P,A,B,H), point_on_bisector(P,B,H,A)};
- polys1 := {(2*( - u1**2*x1**2 + 4*u1**2*x1 + u1**2*x2**2 - 4*u1**2 - 2*u1*u2*x1*
- x2 + 4*u1*u2*x2 + 2*u1*x1**2 - 8*u1*x1 - 2*u1*x2**2 + 8*u1 + 4*u2*x1*x2 - 8*u2*
- x2))/u2,
- (2*u1*( - u1**5*x1 + u1**5 - u1**4*u2*x2 + 6*u1**4*x1 - 6*u1**4 - u1**3*u2**2*x1
- + u1**3*u2**2 - u1**3*u2*x1*x2 + 6*u1**3*u2*x2 - 12*u1**3*x1 + 12*u1**3 - u1**2
- *u2**3*x2 + u1**2*u2**2*x1**2 + 2*u1**2*u2**2*x1 - u1**2*u2**2*x2**2 - 2*u1**2*
- u2**2 + 4*u1**2*u2*x1*x2 - 12*u1**2*u2*x2 + 8*u1**2*x1 - 8*u1**2 + u1*u2**3*x1*
- x2 + 2*u1*u2**3*x2 - 3*u1*u2**2*x1**2 + 3*u1*u2**2*x2**2 - 4*u1*u2*x1*x2 + 8*u1*
- u2*x2 - 2*u2**3*x1*x2 + 2*u2**2*x1**2 - 2*u2**2*x2**2))/u2**3}$
- con1:=cc_tangent(c1_circle(P,x2^2),c1);
- con1 := (4*( - u1**3*x1*x2 + u1**3*x2 + u1**2*u2*x1**2 - 2*u1**2*u2*x1 - u1**2*
- u2*x2**2 + u1**2*u2 + u1**2*x1**2*x2 + u1**2*x1*x2 - 2*u1**2*x2 + u1*u2**2*x1*x2
- - u1*u2**2*x2 - 2*u1*u2*x1**3 + 4*u1*u2*x1**2 - 2*u1*u2*x1 + 2*u1*u2*x2**2 - 2*
- u1*x1**2*x2 + 2*u1*x1*x2 - u2**2*x1**2*x2 + u2**2*x1*x2 + u2*x1**4 - 2*u2*x1**3
- + u2*x1**2 - u2*x2**2))/u2$
-
- setideal(polys1,polys1);
- { - (2*u1**2 - 4*u1)*x1**2 - (4*u1*u2 - 8*u2)*x1*x2 + (8*u1**2 - 16*u1)*x1 + (2*
- u1**2 - 4*u1)*x2**2 + (8*u1*u2 - 16*u2)*x2 - (8*u1**2 - 16*u1),
- (2*u1**3*u2**2 - 6*u1**2*u2**2 + 4*u1*u2**2)*x1**2 - (2*u1**4*u2 - 8*u1**3*u2 -
- 2*u1**2*u2**3 + 8*u1**2*u2 + 4*u1*u2**3)*x1*x2 - (2*u1**6 - 12*u1**5 + 2*u1**4*
- u2**2 + 24*u1**4 - 4*u1**3*u2**2 - 16*u1**3)*x1 - (2*u1**3*u2**2 - 6*u1**2*u2**2
- + 4*u1*u2**2)*x2**2 - (2*u1**5*u2 - 12*u1**4*u2 + 2*u1**3*u2**3 + 24*u1**3*u2 -
- 4*u1**2*u2**3 - 16*u1**2*u2)*x2 + (2*u1**6 - 12*u1**5 + 2*u1**4*u2**2 + 24*u1**
- 4 - 4*u1**3*u2**2 - 16*u1**3)}$
- num con1 mod gbasis polys1;
- 0$
- clear_ndg();
- {}$
- clear A,B,C,P,M,N,H,c1;
- % #############################
- % Solutions to the exercises
- % #############################
- % 1)
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(1,0);
- b := {1,0}$
- C:=Point(1,1);
- c := {1,1}$
- D:=Point(0,1);
- d := {0,1}$
- P:=Point(x1,x2);
- p := {x1,x2}$
- Q:=Point(x3,1);
- q := {x3,1}$
- polys:={point_on_line(P,par(C,pp_line(B,D))),
- sqrdist(B,D)-sqrdist(B,P),
- point_on_line(Q,pp_line(B,P))};
- polys := {x1 + x2 - 2,
- - x1**2 + 2*x1 - x2**2 + 1,
- - x1 + x2*x3 - x2 + 1}$
- con:=sqrdist(D,P)-sqrdist(D,Q);
- con := x1**2 + x2**2 - 2*x2 - x3**2 + 1$
- setring({x1,x2,x3},{},lex);
- {{x1,x2,x3},{},lex,{1,1,1}}$
- setideal(polys,polys);
- {x1 + x2 - 2,
- - x1**2 + 2*x1 - x2**2 + 1,
- - x1 + x2*x3 - x2 + 1}$
- con mod gbasis polys;
- 0$
- clear_ndg();
- {}$
- clear(A,B,C,D,P,Q);
- % 2)
- A:=Point(u1,0);
- a := {u1,0}$
- B:=Point(u2,0);
- b := {u2,0}$
- C:=Point(0,u3);
- c := {0,u3}$
-
- Q:=Point(0,0);
- q := {0,0}$
- % the pedal point on AB
- R:=pedalpoint(B,pp_line(A,C));
- r := {(u1*(u1*u2 + u3**2))/(u1**2 + u3**2),
- (u1*u3*(u1 - u2))/(u1**2 + u3**2)}$
-
- P:=pedalpoint(A,pp_line(B,C));
- p := {(u2*(u1*u2 + u3**2))/(u2**2 + u3**2),
- (u2*u3*( - u1 + u2))/(u2**2 + u3**2)}$
-
- con1:=point_on_bisector(C,P,Q,R);
- con1 := 0$
- con2:=angle_sum(p3_angle(P,Q,C),p3_angle(R,Q,C));
- con2 := 0$
- clear_ndg();
- {}$
- clear(A,B,C,P,Q,R);
- % 3)
- A:=Point(u1,0);
- a := {u1,0}$
- B:=Point(u2,0);
- b := {u2,0}$
- C:=Point(0,u3);
- c := {0,u3}$
-
- P:=pedalpoint(A,pp_line(B,C));
- p := {(u2*(u1*u2 + u3**2))/(u2**2 + u3**2),
- (u2*u3*( - u1 + u2))/(u2**2 + u3**2)}$
-
- Q:=pedalpoint(B,pp_line(A,C));
- q := {(u1*(u1*u2 + u3**2))/(u1**2 + u3**2),
- (u1*u3*(u1 - u2))/(u1**2 + u3**2)}$
-
- R:=pedalpoint(C,pp_line(A,B));
- r := {0,0}$
- P1:=pedalpoint(P,pp_line(A,B));
- p1 := {(u2*(u1*u2 + u3**2))/(u2**2 + u3**2),0}$
- P2:=pedalpoint(P,pp_line(A,C));
- p2 := {(u1*(u1**2*u2**2 + 2*u1*u2*u3**2 + u3**4))/(u1**2*u2**2 + u1**2*u3**2 +
- u2**2*u3**2 + u3**4),
- (u3**3*(u1**2 - 2*u1*u2 + u2**2))/(u1**2*u2**2 + u1**2*u3**2 + u2**2*u3**2 + u3
- **4)}$
- Q1:=pedalpoint(Q,pp_line(A,B));
- q1 := {(u1*(u1*u2 + u3**2))/(u1**2 + u3**2),0}$
- Q2:=pedalpoint(Q,pp_line(B,C));
- q2 := {(u2*(u1**2*u2**2 + 2*u1*u2*u3**2 + u3**4))/(u1**2*u2**2 + u1**2*u3**2 +
- u2**2*u3**2 + u3**4),
- (u3**3*(u1**2 - 2*u1*u2 + u2**2))/(u1**2*u2**2 + u1**2*u3**2 + u2**2*u3**2 + u3
- **4)}$
- R1:=pedalpoint(R,pp_line(A,C));
- r1 := {(u1*u3**2)/(u1**2 + u3**2),(u1**2*u3)/(u1**2 + u3**2)}$
- R2:=pedalpoint(R,pp_line(B,C));
- r2 := {(u2*u3**2)/(u2**2 + u3**2),(u2**2*u3)/(u2**2 + u3**2)}$
- con:=for each X in {Q2,R1,R2} collect p4_circle(P1,P2,Q1,X);
- con := {0,0,0}$
- clear_ndg();
- {}$
- clear(O,A,B,C,P,Q,R,P1,P2,Q1,Q2,R1,R2);
- % 4)
- A:=Point(u1,0);
- a := {u1,0}$
- B:=Point(u2,0);
- b := {u2,0}$
- C:=Point(0,u3);
- c := {0,u3}$
-
- % => Pedalpoint from C is (0,0)
- M:=intersection_point(mp(A,B),mp(B,C));
- m := {(u1 + u2)/2,(u1*u2 + u3**2)/(2*u3)}$
- % Prove (2*h_c*R = a*b)^2
- con:=4*u3^2*sqrdist(M,A)-sqrdist(C,B)*sqrdist(A,C);
- con := 0$
- clear_ndg();
- {}$
- clear(A,B,C,M);
- % 5. A solution of constructive type.
- on gcd;
- O:=Point(0,u1);
- o := {0,u1}$
- A:=Point(0,0);
- a := {0,0}$
- % hence k has radius u1.
- B:=Point(u2,0);
- b := {u2,0}$
- M:=midpoint(A,B);
- m := {u2/2,0}$
- D:=choose_pc(O,u1,u3);
- d := {(u1*(u3**2 - 1))/(u3**2 + 1),(u1*(u3**2 + 2*u3 + 1))/(u3**2 + 1)}$
-
- k:=c1_circle(O,u1^2);
- k := {1,0, - 2*u1,0}$
- C:=other_cl_point(D,k,pp_line(M,D));
- c := {(u1*u2*(4*u1*u3**2 + 8*u1*u3 + 4*u1 - u2*u3**2 + u2))/(8*u1**2*u3**2 + 16*
- u1**2*u3 + 8*u1**2 - 4*u1*u2*u3**2 + 4*u1*u2 + u2**2*u3**2 + u2**2),
- (u1*u2**2*(u3**2 + 2*u3 + 1))/(8*u1**2*u3**2 + 16*u1**2*u3 + 8*u1**2 - 4*u1*u2*
- u3**2 + 4*u1*u2 + u2**2*u3**2 + u2**2)}$
- Eh:=other_cl_point(D,k,pp_line(B,D));
- eh := {(u1*u2*(2*u1*u3**2 + 4*u1*u3 + 2*u1 - u2*u3**2 + u2))/(2*u1**2*u3**2 + 4*
- u1**2*u3 + 2*u1**2 - 2*u1*u2*u3**2 + 2*u1*u2 + u2**2*u3**2 + u2**2),
- (u1*u2**2*(u3**2 + 2*u3 + 1))/(2*u1**2*u3**2 + 4*u1**2*u3 + 2*u1**2 - 2*u1*u2*u3
- **2 + 2*u1*u2 + u2**2*u3**2 + u2**2)}$
- F:=other_cl_point(C,k,pp_line(B,C));
- f := {(u1*u2*( - 2*u1*u3**2 - 4*u1*u3 - 2*u1 + u2*u3**2 - u2))/(2*u1**2*u3**2 +
- 4*u1**2*u3 + 2*u1**2 - 2*u1*u2*u3**2 + 2*u1*u2 + u2**2*u3**2 + u2**2),
- (u1*u2**2*(u3**2 + 2*u3 + 1))/(2*u1**2*u3**2 + 4*u1**2*u3 + 2*u1**2 - 2*u1*u2*u3
- **2 + 2*u1*u2 + u2**2*u3**2 + u2**2)}$
- con:=parallel(pp_line(A,B),pp_line(Eh,F));
- con := 0$
- off gcd;
- clear_ndg();
- {}$
- clear(O,A,B,C,D,Eh,F,M,k);
- % 6)
- Z:=Point(0,0);
- z := {0,0}$
- X:=Point(0,1);
- x := {0,1}$
- Y:=Point(0,-1);
- y := {0,-1}$
-
- B:=Point(u1,0);
- b := {u1,0}$
- C:=Point(u2,0);
- c := {u2,0}$
- P:=Point(0,u3);
- p := {0,u3}$
- M:=Point(x1,x2);
- m := {x1,x2}$
- N:=Point(x3,x4);
- n := {x3,x4}$
-
- A:=Point(x5,0);
- a := {x5,0}$
- D:=Point(x6,0);
- d := {x6,0}$
- polys:={p4_circle(X,Y,B,N), p4_circle(X,Y,C,M),
- p4_circle(X,Y,B,D), p4_circle(X,Y,C,A),
- collinear(B,P,N), collinear(C,P,M)};
- polys := {2*( - u1**2*x3 + u1*x3**2 + u1*x4**2 - u1 + x3),
- 2*( - u2**2*x1 + u2*x1**2 + u2*x2**2 - u2 + x1),
- 2*( - u1**2*x6 + u1*x6**2 - u1 + x6),
- 2*( - u2**2*x5 + u2*x5**2 - u2 + x5),
- u1*u3 - u1*x4 - u3*x3,
- u2*u3 - u2*x2 - u3*x1}$
- con:=concurrent(pp_line(A,M),pp_line(D,N),pp_line(X,Y));
- con := 2*( - x1*x4*x6 + x2*x3*x5 - x2*x5*x6 + x4*x5*x6)$
- vars:={x1,x2,x3,x4,x5,x6};
- vars := {x1,
- x2,
- x3,
- x4,
- x5,
- x6}$
- setring(vars,{},lex);
- {{x1,x2,x3,x4,x5,x6},{},lex,{1,1,1,1,1,1}}$
- res:=groebfactor(polys,{x5-u2,x1-u2,x6-u1,x3-u1});
- res := {{u1*x6 + 1,
- (u2**2 + u3**2)*x2 - (u2**2*u3 + u3),
- (u2**2 + u3**2)*x1 - (u2*u3**2 - u2),
- (u1**2 + u3**2)*x4 - (u1**2*u3 + u3),
- (u1**2 + u3**2)*x3 - (u1*u3**2 - u1),
- u2*x5 + 1}}$
- % constraints A\neq C, M\neq C, D\neq B, N\neq B
- for each u in res collect con mod u;
- {0}$
- clear_ndg();
- {}$
- clear(Z,X,Y,B,C,P,M,N,A,D);
- % 7)
- M:=Point(0,0);
- m := {0,0}$
- A:=Point(0,u1);
- a := {0,u1}$
- B:=Point(-1,0);
- b := {-1,0}$
- C:=Point(1,0);
- c := {1,0}$
-
- Eh:=varpoint(A,B,x1);
- eh := {x1 - 1,u1*x1}$
- F:=varpoint(A,C,x2);
- f := { - x2 + 1,u1*x2}$
- O:=intersection_point(pp_line(A,M),lot(B,pp_line(A,B)));
- o := {0,( - 1)/u1}$
-
- Q:=intersection_point(pp_line(Eh,F),pp_line(B,C));
- q := {( - 2*x1*x2 + x1 + x2)/(x1 - x2),0}$
- con1:=num orthogonal(pp_line(O,Q),pp_line(Eh,Q));
- con1 := 2*x1*(x1**2*x2 - x1**2 + x1*x2**2 - 2*x1*x2 + x1 - x2**2 + x2)$
- con2:=num sqrdist(Q,midpoint(Eh,F));
- con2 := u1**2*x1**4 - 2*u1**2*x1**2*x2**2 + u1**2*x2**4 + x1**4 + 4*x1**3*x2 - 4
- *x1**3 + 6*x1**2*x2**2 - 12*x1**2*x2 + 4*x1**2 + 4*x1*x2**3 - 12*x1*x2**2 + 8*x1
- *x2 + x2**4 - 4*x2**3 + 4*x2**2$
- vars:={x1,x2};
- vars := {x1,x2}$
- setring(vars,{},lex);
- {{x1,x2},{},lex,{1,1}}$
- p1:=groebfactor({con1},{x1-1,x2-1,x1,x2});
- p1 := {{x1 + x2}}$
- p2:=groebfactor({con2},{x1-1,x2-1,x1,x2});
- p2 := {{x1 + x2},
- {(u1**2 + 1)*x1**2 - (2*u1**2 - 2)*x1*x2 - 4*x1 + (u1**2 + 1)*x2**2 - 4*x2 + 4}}
- $
- % constraint A,C\neq Eh, B,C\neq F
- for each u in p1 collect con2 mod u;
- {0}$
- for each u in p2 collect con1 mod u;
- {0,
- (2*(5*u1**4*x1*x2**3 - 8*u1**4*x1*x2**2 + 3*u1**4*x1*x2 - 3*u1**4*x2**4 + 4*u1**
- 4*x2**3 - u1**4*x2**2 - 10*u1**2*x1*x2**3 + 32*u1**2*x1*x2**2 - 30*u1**2*x1*x2 +
- 8*u1**2*x1 - 2*u1**2*x2**4 + 12*u1**2*x2**3 - 26*u1**2*x2**2 + 20*u1**2*x2 - 4*
- u1**2 + x1*x2**3 - 8*x1*x2**2 + 15*x1*x2 - 8*x1 + x2**4 - 8*x2**3 + 23*x2**2 -
- 28*x2 + 12))/(u1**4 + 2*u1**2 + 1)}$
- % Note that the second component of p2 has no relevant *real* roots,
- % since it factors as u1^2 * (x1 - x2)^2 + (x1 + x2 -2)^2 :
- u1^2 * (x1 - x2)^2 + (x1 + x2 -2)^2 mod second p2;
- 0$
- clear_ndg();
- {}$
- clear(M,A,B,C,O,Eh,F,Q);
- % 8)
- on gcd;
-
- A:=Point(u1,0);
- a := {u1,0}$
- B:=Point(u2,0);
- b := {u2,0}$
- l1:=pp_line(A,B);
- l1 := {0,u1 - u2,0}$
- M:=Point(0,u3);
- m := {0,u3}$
- % the incenter, hence u3 = incircle radius
- C:=intersection_point(symline(l1,pp_line(A,M)),
- symline(l1,pp_line(B,M)));
- c := {(u3**2*(u1 + u2))/(u1*u2 + u3**2),
- (2*u1*u2*u3)/(u1*u2 + u3**2)}$
-
- N:=intersection_point(mp(A,B),mp(B,C));
- n := {(u1 + u2)/2,
- (u1**2*u2**2 - u1**2*u3**2 + 4*u1*u2*u3**2 - u2**2*u3**2 + u3**4)/(4*u3*(u1*u2 +
- u3**2))}$
- % the outcenter
- sqr_rad:=sqrdist(A,N);
- sqr_rad := (u1**4*u2**4 + 2*u1**4*u2**2*u3**2 + u1**4*u3**4 + 2*u1**2*u2**4*u3**
- 2 + 4*u1**2*u2**2*u3**4 + 2*u1**2*u3**6 + u2**4*u3**4 + 2*u2**2*u3**6 + u3**8)/(
- 16*u3**2*(u1**2*u2**2 + 2*u1*u2*u3**2 + u3**4))$
- % the outcircle sqradius.
- (sqr_rad-sqrdist(M,N))^2-4*u3^2*sqr_rad;
- 0$
- off gcd;
- clear_ndg();
- {}$
- clear A,B,C,M,N,l1,sqr_rad;
- % 9)
- on gcd;
- A:=Point(0,0);
- a := {0,0}$
- B:=Point(1,0);
- b := {1,0}$
- M:=Point(u1,0);
- m := {u1,0}$
- C:=Point(u1,u1);
- c := {u1,u1}$
- F:=Point(u1,1-u1);
- f := {u1, - u1 + 1}$
- c1:=red_hom_coords p3_circle(A,M,C);
- c1 := {1, - u1, - u1,0}$
-
- c2:=red_hom_coords p3_circle(B,M,F);
- c2 := {-1,u1 + 1, - u1 + 1, - u1}$
- N:=other_cc_point(M,c1,c2);
- n := {u1**2/(2*u1**2 - 2*u1 + 1),(u1*( - u1 + 1))/(2*u1**2 - 2*u1 + 1)}$
- point_on_line(N,pp_line(A,F));
- 0$
- point_on_line(N,pp_line(B,C));
- 0$
- l1:=red_hom_coords pp_line(M,N);
- l1 := {-1,2*u1 - 1,u1}$
- l2:=sub(u1=u2,l1);
- l2 := {-1,2*u2 - 1,u2}$
- intersection_point(l1,l2);
- {1/2,( - 1)/2}$
- % = (1/2,-1/2)
- off gcd;
- clear_ndg();
- {}$
- clear A,B,C,F,M,N,c1,c2,l1,l2;
- % ####################
- % Some more examples
- % ####################
- % Origin: D. Wang at
- % http://cosmos.imag.fr/ATINF/Dongming.Wang/geother.html
- % --------------------------
- % Given triangle ABC, H orthocenter, O circumcenter, A1 circumcenter
- % of BHC, B1 circumcenter of AHC.
- %
- % Claim: OH, AA1, BB1 are concurrent.
- % --------------------------
- A:=Point(u1,0);
- a := {u1,0}$
- B:=Point(u2,0);
- b := {u2,0}$
- C:=Point(0,u3);
- c := {0,u3}$
-
- H:=intersection_point(altitude(C,A,B),altitude(A,B,C));
- h := {0,( - u1*u2)/u3}$
- O:=circle_center(p3_circle(A,B,C));
- o := {(u1 + u2)/2,(u1*u2 + u3**2)/(2*u3)}$
-
- A1:=circle_center(p3_circle(H,B,C));
- a1 := {( - u1 + u2)/2,( - u1*u2 + u3**2)/(2*u3)}$
-
- B1:=circle_center(p3_circle(H,A,C));
- b1 := {(u1 - u2)/2,( - u1*u2 + u3**2)/(2*u3)}$
-
- con:=concurrent(pp_line(O,H),pp_line(A,A1),pp_line(B,B1));
- con := 0$
- end;
- 4: 4: 4: 4: 4: 4: 4: 4: 4:
- Time for test: 9680 ms, plus GC time: 880 ms
- 5: 5:
- Quitting
- Thu Jan 28 23:38:39 MET 1999
|