geoprover.tst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. % GeoProver test file for Reduce, created on Jan 18 2003
  2. load cali,geoprover;
  3. off nat; on echo;
  4. %in "$reduce/packages/geometry/supp.red"$
  5. %###############################################################
  6. %
  7. % FILE: supp.red
  8. % AUTHOR: graebe
  9. % CREATED: 2/2002
  10. % PURPOSE: Interface for the extended GEO syntax to Reduce
  11. % VERSION: $Id: supp.red,v 1.1 2002/12/26 16:27:22 compalg Exp $
  12. algebraic procedure geo_simplify u; u;
  13. algebraic procedure geo_normal u; u;
  14. algebraic procedure geo_subs(a,b,c); sub(a=b,c);
  15. algebraic procedure geo_gbasis(polys,vars);
  16. begin
  17. setring(vars,{},lex);
  18. setideal(uhu,polys);
  19. return gbasis uhu;
  20. end;
  21. algebraic procedure geo_groebfactor(polys,vars,nondeg);
  22. begin
  23. setring(vars,{},lex);
  24. return groebfactor(polys,nondeg);
  25. end;
  26. algebraic procedure geo_normalf(p,polys,vars);
  27. begin
  28. setring(vars,{},lex);
  29. return p mod polys;
  30. end;
  31. algebraic procedure geo_eliminate(polys,vars,elivars);
  32. begin
  33. setring(vars,{},lex);
  34. return eliminate(polys,elivars);
  35. end;
  36. algebraic procedure geo_solve(polys,vars);
  37. solve(polys,vars);
  38. algebraic procedure geo_solveconstrained(polys,vars,nondegs);
  39. begin scalar u;
  40. setring(vars,{},lex);
  41. u:=groebfactor(polys,nondegs);
  42. return for each x in u join solve(x,vars);
  43. end;
  44. algebraic procedure geo_eval(con,sol);
  45. for each x in sol collect sub(x,con);
  46. % end;
  47. % Example Arnon
  48. %
  49. % The problem:
  50. % Let $ABCD$ be a square and $P$ a point on the line parallel to $BD$
  51. % through $C$ such that $l(BD)=l(BP)$, where $l(BD)$ denotes the
  52. % distance between $B$ and $D$. Let $Q$ be the intersection point of
  53. % $BF$ and $CD$. Show that $l(DP)=l(DQ)$.
  54. %
  55. % The solution:
  56. vars_:=List(x1, x2, x3);
  57. % Points
  58. A__:=Point(0,0); B__:=Point(1,0); P__:=Point(x1,x2);
  59. % coordinates
  60. D__:=rotate(A__,B__,1/2);
  61. C__:=par_point(D__,A__,B__);
  62. Q__:=varpoint(D__,C__,x3);
  63. % polynomials
  64. polys_:=List(on_line(P__,par_line(C__,pp_line(B__,D__))),
  65. eq_dist(B__,D__,B__,P__), on_line(Q__,pp_line(B__,P__)));
  66. % conclusion
  67. con_:=eq_dist(D__,P__,D__,Q__);
  68. % solution
  69. gb_:=geo_gbasis(polys_,vars_);
  70. result_:=geo_normalf(con_,gb_,vars_);
  71. % Example CircumCenter_1
  72. %
  73. % The problem:
  74. % The intersection point of the midpoint perpendiculars is the
  75. % center of the circumscribed circle.
  76. %
  77. % The solution:
  78. parameters_:=List(a1, a2, b1, b2, c1, c2);
  79. % Points
  80. A__:=Point(a1,a2);
  81. B__:=Point(b1,b2);
  82. C__:=Point(c1,c2);
  83. % coordinates
  84. M__:=intersection_point(p_bisector(A__,B__),
  85. p_bisector(B__,C__));
  86. % conclusion
  87. result_:=List( eq_dist(M__,A__,M__,B__), eq_dist(M__,A__,M__,C__) );
  88. % Example EulerLine_1
  89. %
  90. % The problem:
  91. % Euler's line: The center $M$ of the circumscribed circle,
  92. % the orthocenter $H$ and the barycenter $S$ are collinear and $S$
  93. % divides $MH$ with ratio 1:2.
  94. %
  95. % The solution:
  96. parameters_:=List(a1, a2, b1, b2, c1, c2);
  97. % Points
  98. A__:=Point(a1,a2);
  99. B__:=Point(b1,b2);
  100. C__:=Point(c1,c2);
  101. % coordinates
  102. S__:=intersection_point(median(A__,B__,C__),median(B__,C__,A__));
  103. M__:=intersection_point(p_bisector(A__,B__),
  104. p_bisector(B__,C__));
  105. H__:=intersection_point(altitude(A__,B__,C__),altitude(B__,C__,A__));
  106. % conclusion
  107. result_:=List(is_collinear(M__,H__,S__), sqrdist(S__,fixedpoint(M__,H__,1/3)));
  108. % Example Brocard_3
  109. %
  110. % The problem:
  111. % Theorem about the Brocard points:
  112. % Let $\Delta\,ABC$ be a triangle. The circles $c_1$ through $A,B$ and
  113. % tangent to $g(AC)$, $c_2$ through $B,C$ and tangent to $g(AB)$, and
  114. % $c_3$ through $A,C$ and tangent to $g(BC)$ pass through a common
  115. % point.
  116. %
  117. % The solution:
  118. parameters_:=List(u1, u2);
  119. % Points
  120. A__:=Point(0,0);
  121. B__:=Point(1,0);
  122. C__:=Point(u1,u2);
  123. % coordinates
  124. M_1_:=intersection_point(altitude(A__,A__,C__),p_bisector(A__,B__));
  125. M_2_:=intersection_point(altitude(B__,B__,A__),p_bisector(B__,C__));
  126. M_3_:=intersection_point(altitude(C__,C__,B__),p_bisector(A__,C__));
  127. c1_:=pc_circle(M_1_,A__);
  128. c2_:=pc_circle(M_2_,B__);
  129. c3_:=pc_circle(M_3_,C__);
  130. P__:=other_cc_point(B__,c1_,c2_);
  131. % conclusion
  132. result_:= on_circle(P__,c3_);
  133. % Example Feuerbach_1
  134. %
  135. % The problem:
  136. % Feuerbach's circle or nine-point circle: The midpoint $N$ of $MH$ is
  137. % the center of a circle that passes through nine special points, the
  138. % three pedal points of the altitudes, the midpoints of the sides of the
  139. % triangle and the midpoints of the upper parts of the three altitudes.
  140. %
  141. % The solution:
  142. parameters_:=List(u1, u2, u3);
  143. % Points
  144. A__:=Point(0,0);
  145. B__:=Point(u1,0);
  146. C__:=Point(u2,u3);
  147. % coordinates
  148. H__:=intersection_point(altitude(A__,B__,C__),altitude(B__,C__,A__));
  149. D__:=intersection_point(pp_line(A__,B__),pp_line(H__,C__));
  150. M__:=intersection_point(p_bisector(A__,B__),
  151. p_bisector(B__,C__));
  152. N__:=midpoint(M__,H__);
  153. % conclusion
  154. result_:=List( eq_dist(N__,midpoint(A__,B__),N__,midpoint(B__,C__)),
  155. eq_dist(N__,midpoint(A__,B__),N__,midpoint(H__,C__)),
  156. eq_dist(N__,midpoint(A__,B__),N__,D__) );
  157. % Example FeuerbachTangency_1
  158. %
  159. % The problem:
  160. % For an arbitrary triangle $\Delta\,ABC$ Feuerbach's circle (nine-point
  161. % circle) is tangent to its 4 tangent circles.
  162. %
  163. % The solution:
  164. vars_:=List(x1, x2);
  165. parameters_:=List(u1, u2);
  166. % Points
  167. A__:=Point(0,0);
  168. B__:=Point(2,0);
  169. C__:=Point(u1,u2);
  170. P__:=Point(x1,x2);
  171. % coordinates
  172. M__:=intersection_point(p_bisector(A__,B__), p_bisector(B__,C__));
  173. H__:=intersection_point(altitude(A__,B__,C__),altitude(B__,C__,A__));
  174. N__:=midpoint(M__,H__);
  175. c1_:=pc_circle(N__,midpoint(A__,B__));
  176. Q__:=pedalpoint(P__,pp_line(A__,B__));
  177. % polynomials
  178. polys_:=List(on_bisector(P__,A__,B__,C__), on_bisector(P__,B__,C__,A__));
  179. % conclusion
  180. con_:=is_cc_tangent(pc_circle(P__,Q__),c1_);
  181. % solution
  182. gb_:=geo_gbasis(polys_,vars_);
  183. result_:=geo_normalf(con_,gb_,vars_);
  184. % Example GeneralizedFermatPoint_1
  185. %
  186. % The problem:
  187. % A generalized theorem about Napoleon triangles:
  188. % Let $\Delta\,ABC$ be an arbitrary triangle and $P,Q$ and $R$ the third
  189. % vertex of isosceles triangles with equal base angles erected
  190. % externally on the sides $BC, AC$ and $AB$ of the triangle. Then the
  191. % lines $g(AP), g(BQ)$ and $g(CR)$ pass through a common point.
  192. %
  193. % The solution:
  194. vars_:=List(x1, x2, x3, x4, x5);
  195. parameters_:=List(u1, u2, u3);
  196. % Points
  197. A__:=Point(0,0);
  198. B__:=Point(2,0);
  199. C__:=Point(u1,u2);
  200. P__:=Point(x1,x2);
  201. Q__:=Point(x3,x4);
  202. R__:=Point(x5,u3);
  203. % polynomials
  204. polys_:=List(eq_dist(P__,B__,P__,C__),
  205. eq_dist(Q__,A__,Q__,C__),
  206. eq_dist(R__,A__,R__,B__),
  207. eq_angle(R__,A__,B__,P__,B__,C__),
  208. eq_angle(Q__,C__,A__,P__,B__,C__));
  209. % conclusion
  210. con_:=is_concurrent(pp_line(A__,P__), pp_line(B__,Q__), pp_line(C__,R__));
  211. % solution
  212. sol_:=geo_solve(polys_,vars_);
  213. result_:=geo_eval(con_,sol_);
  214. % Example TaylorCircle_1
  215. %
  216. % The problem:
  217. % Let $\Delta\,ABC$ be an arbitrary triangle. Consider the three
  218. % altitude pedal points and the pedal points of the perpendiculars from
  219. % these points onto the the opposite sides of the triangle. Show that
  220. % these 6 points are on a common circle, the {\em Taylor circle}.
  221. %
  222. % The solution:
  223. parameters_:=List(u1, u2, u3);
  224. % Points
  225. A__:=Point(u1,0);
  226. B__:=Point(u2,0);
  227. C__:=Point(0,u3);
  228. % coordinates
  229. P__:=pedalpoint(A__,pp_line(B__,C__));
  230. Q__:=pedalpoint(B__,pp_line(A__,C__));
  231. R__:=pedalpoint(C__,pp_line(A__,B__));
  232. P_1_:=pedalpoint(P__,pp_line(A__,B__));
  233. P_2_:=pedalpoint(P__,pp_line(A__,C__));
  234. Q_1_:=pedalpoint(Q__,pp_line(A__,B__));
  235. Q_2_:=pedalpoint(Q__,pp_line(B__,C__));
  236. R_1_:=pedalpoint(R__,pp_line(A__,C__));
  237. R_2_:=pedalpoint(R__,pp_line(B__,C__));
  238. % conclusion
  239. result_:=List( is_concyclic(P_1_,P_2_,Q_1_,Q_2_),
  240. is_concyclic(P_1_,P_2_,Q_1_,R_1_),
  241. is_concyclic(P_1_,P_2_,Q_1_,R_2_));
  242. % Example Miquel_1
  243. %
  244. % The problem:
  245. % Miquels theorem: Let $\Delta\,ABC$ be a triangle. Fix arbitrary points
  246. % $P,Q,R$ on the sides $AB, BC, AC$. Then the three circles through each
  247. % vertex and the chosen points on adjacent sides pass through a common
  248. % point.
  249. %
  250. % The solution:
  251. parameters_:=List(c1, c2, u1, u2, u3);
  252. % Points
  253. A__:=Point(0,0);
  254. B__:=Point(1,0);
  255. C__:=Point(c1,c2);
  256. % coordinates
  257. P__:=varpoint(A__,B__,u1);
  258. Q__:=varpoint(B__,C__,u2);
  259. R__:=varpoint(A__,C__,u3);
  260. X__:=other_cc_point(P__,p3_circle(A__,P__,R__),p3_circle(B__,P__,Q__));
  261. % conclusion
  262. result_:=on_circle(X__,p3_circle(C__,Q__,R__));
  263. % Example PappusPoint_1
  264. %
  265. % The problem:
  266. % Let $A,B,C$ and $P,Q,R$ be two triples of collinear points. Then by
  267. % the Theorem of Pappus the intersection points $g(AQ)\wedge g(BP),
  268. % g(AR)\wedge g(CP)$ and $g(BR)\wedge g(CQ)$ are collinear.
  269. %
  270. % Permuting $P,Q,R$ we get six such {\em Pappus lines}. Those
  271. % corresponding to even resp. odd permutations are concurrent.
  272. %
  273. % The solution:
  274. parameters_:=List(u1, u2, u3, u4, u5, u6, u7, u8);
  275. % Points
  276. A__:=Point(u1,0);
  277. B__:=Point(u2,0);
  278. P__:=Point(u4,u5);
  279. Q__:=Point(u6,u7);
  280. % coordinates
  281. C__:=varpoint(A__,B__,u3);
  282. R__:=varpoint(P__,Q__,u8);
  283. % conclusion
  284. result_:=is_concurrent(pappus_line(A__,B__,C__,P__,Q__,R__),
  285. pappus_line(A__,B__,C__,Q__,R__,P__),
  286. pappus_line(A__,B__,C__,R__,P__,Q__));
  287. % Example IMO/36_1
  288. %
  289. % The problem:
  290. % Let $A,B,C,D$ be four distinct points on a line, in that order. The
  291. % circles with diameters $AC$ and $BD$ intersect at the points $X$ and
  292. % $Y$. The line $XY$ meets $BC$ at the point $Z$. Let $P$ be a point on
  293. % the line $XY$ different from $Z$. The line $CP$ intersects the circle
  294. % with diameter $AC$ at the points $C$ and $M$, and the line $BP$
  295. % intersects the circle with diameter $BD$ at the points $B$ and
  296. % $N$. Prove that the lines $AM, DN$ and $XY$ are concurrent.
  297. %
  298. % The solution:
  299. vars_:=List(x1, x2, x3, x4, x5, x6);
  300. parameters_:=List(u1, u2, u3);
  301. % Points
  302. X__:=Point(0,1);
  303. Y__:=Point(0,-1);
  304. M__:=Point(x1,x2);
  305. N__:=Point(x3,x4);
  306. % coordinates
  307. P__:=varpoint(X__,Y__,u3);
  308. Z__:=midpoint(X__,Y__);
  309. l_:=p_bisector(X__,Y__);
  310. B__:=line_slider(l_,u1);
  311. C__:=line_slider(l_,u2);
  312. A__:=line_slider(l_,x5);
  313. D__:=line_slider(l_,x6);
  314. % polynomials
  315. polys_:=List(is_concyclic(X__,Y__,B__,N__), is_concyclic(X__,Y__,C__,M__),
  316. is_concyclic(X__,Y__,B__,D__), is_concyclic(X__,Y__,C__,A__),
  317. is_collinear(B__,P__,N__), is_collinear(C__,P__,M__));
  318. % constraints
  319. nondeg_:=List(x5-u2,x1-u2,x6-u1,x3-u1);
  320. % conclusion
  321. con_:=is_concurrent(pp_line(A__,M__),pp_line(D__,N__),pp_line(X__,Y__));
  322. % solution
  323. sol_:=geo_solveconstrained(polys_,vars_,nondeg_);
  324. result_:=geo_eval(con_,sol_);
  325. % Example IMO/43_2
  326. %
  327. % The problem:
  328. %
  329. % No verbal problem description available
  330. %
  331. % The solution:
  332. vars_:=List(x1, x2);
  333. parameters_:=List(u1);
  334. % Points
  335. B__:=Point(-1,0);
  336. C__:=Point(1,0);
  337. % coordinates
  338. O__:=midpoint(B__,C__);
  339. gamma_:=pc_circle(O__,B__);
  340. D__:=circle_slider(O__,B__,u1);
  341. E__:=circle_slider(O__,B__,x1);
  342. F__:=circle_slider(O__,B__,x2);
  343. A__:=sym_point(B__,pp_line(O__,D__));
  344. J__:=intersection_point(pp_line(A__,C__), par_line(O__, pp_line(A__,D__)));
  345. m_:=p_bisector(O__,A__);
  346. P_1_:=pedalpoint(J__,m_);
  347. P_2_:=pedalpoint(J__,pp_line(C__,E__));
  348. P_3_:=pedalpoint(J__,pp_line(C__,F__));
  349. % polynomials
  350. polys_:=List(on_line(E__,m_), on_line(F__,m_));
  351. % constraints
  352. nondegs_:=List(x1-x2);
  353. % conclusion
  354. con_:=List(eq_dist(J__,P_1_,J__,P_2_), eq_dist(J__,P_1_,J__,P_3_));
  355. % solution
  356. sol_:=geo_solveconstrained(polys_,vars_,nondegs_);
  357. result_:=geo_simplify(geo_eval(con_,sol_));
  358. showtime;
  359. end;