;;; ;;;Proposition #47--Euclid's proof of Pythagorean Theorem ;;; ;;; by Takaya Iwamoto Nov 18,2001 ;;; ;;; ;;; euclid_47_1 Euclid's Proof in the "Elements" (c 300 B.C.) ;;; euclid_47_2a ;;; euclid_47_2b dissection_1 ;;; euclid_47_2c dissection_2 ;;; euclid_47_2d dissection_3 ;;; euclid_47_3 Quadrilateral version of Proof #1 ;;; euclid_47_4 Generalization by Pappus of Alexandria ;;; euclid_47_5 Leonardo da Vinci (1452 - 1519) ;;; euclid_47_6 Thabit ibn Qurra (826 - 901) ;;; euclid_47_7 Pythagoras ;;; euclid_47_8 ;;; euclid_47_9 Yanney's proof ;;; ;;; dissection General dissection scheme ;;; dissect_1 Liu Hui's proof ;;; dissect_2 J.E.Boettcher's proof ;;; refresh_all delete all objects(incl. block) for restart ;;; Abe_origami_1 Hisashi Abe's origami solution(original) ;;; Abe_origami_2 Hisashi Abe's origami solution(variation) ;;; ;;;*****************EUCLID_47_1******************************************************* ;;; Proof by Euclid ;;; ;;; Euclid_main (defun c:Euclid_main() (setq dcl_id (load_dialog "euclid_47.dcl")) (if (not (new_dialog "euclid_47" dcl_id)) (exit) ) (setq proof_list '("47_1" "47_d1" "47_d2" "47_d3" "47_3" "47_4" "47_5" "47_6" "47_7" "47_8" "47_9" "47_grid" "47_LH" "47_BO" "") ) (foreach sld_name proof_list (start_image sld_name) (slide_image 0 0 (- (dimx_tile sld_name) 1) (- (dimy_tile sld_name) 1) (strcat "euclid_47" "(" sld_name ")") ) (end_image) );;;end of foreach loop (setq pr_mode "47_1") (mode_tile pr_mode 4) (foreach pd0 proof_list (action_tile pd0 "(mode_tile pr_mode 4) (setq pr_mode $key)(mode_tile pr_mode 4)" ) ) (action_tile "help" "(help \"\" \"ddptype\")") (start_dialog) ;;;execute the selected program (cond ((= pr_mode "47_1") (c:euclid_47_1) ) ((= pr_mode "47_d1") (c:euclid_47_2b) ) ((= pr_mode "47_d2") (c:euclid_47_2c) ) ((= pr_mode "47_d3") (c:euclid_47_2d) ) ((= pr_mode "47_3") (c:euclid_47_3) ) ((= pr_mode "47_4") (c:euclid_47_4) ) ((= pr_mode "47_5") (c:euclid_47_5) ) ((= pr_mode "47_6") (c:euclid_47_6) ) ((= pr_mode "47_7") (c:euclid_47_7) ) ((= pr_mode "47_8") (c:euclid_47_8) ) ((= pr_mode "47_9") (c:euclid_47_9) ) ((= pr_mode "47_grid") (c:dissection) ) ((= pr_mode "47_LH") (c:dissect_1) ) ((= pr_mode "47_BO") (c:dissect_2) ) (t nil) );;;end of cond );;;EUCLID_MAIN ;;; (defun c:Euclid_47_1() (setup_47_1) (make_jpg) (make_jpg) (step_11_text) (alert " Step 1: \nTriangle ACK ---> Triangle BCK\n\n(common base CK, height is AC)") (setq ACK (shaded_triangle "layer3" pnt_a pnt_c pnt_k )) (make_jpg) (command "_.delay" 2000) (setq pnt_cr1 '(7.6 5.7) pnt_cr2 '(-2.6 -5.5)) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_1" pnt_d whole) (command "oops") (my_block_insert "WHOLE_1" '(8.5 3.5) 0.4) (command "_.zoom" "E") (make_jpg) (entdel ACK) (command "_.layer" "set" "layer3" "") (tri_along_line "layer3" pnt_a pnt_b n_sec n_speed pnt_c pnt_k 1) (setq trig_BCK last_hatch) (make_jpg) (entdel last_pline) (make_line_1 "layer8" 8 pnt_a pnt_l) (step_21_text) (make_jpg) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_2" pnt_d whole) (command "oops") (my_block_insert "WHOLE_2" '(12.75 3.5) 0.4) (command "_.zoom" "E") (make_jpg) (alert " Step 2: \nRotate Triangle BCK about C\n ---> Triangle ECA") (rotate_ent trig_BCK pnt_c pnt_k 90. 25 25 1) (make_jpg) (step_31_text) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_3" pnt_d whole) (command "oops") (my_block_insert "WHOLE_3" '(17.0 3.5) 0.4) (command "_.zoom" "E") (make_jpg) (make_jpg) (entdel trig_BCK) (alert " Step 3: \nTriangle ACE \n---> Triangle LEC") (command "_.layer" "set" "layer3" "") (tri_along_line "layer3" pnt_a pnt_l n_sec n_speed pnt_c pnt_e 1) (setq trig_LEC last_hatch) (make_jpg) (entdel last_pline) (setq trig_ACK (shaded_triangle "layer3" pnt_a pnt_c pnt_k)) (make_jpg) (step_41_text) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_4" pnt_d whole) (command "oops") (my_block_insert "WHOLE_4" '(21.25 3.5) 0.4) (command "_.zoom" "E") (make_jpg) (alert " It is proved that\narea of ACK == area of CLE") (blink_layer "layer3" 100 3) (alert " Step 4: \nTriangle AFB ---> Triangle CFB") (setq AFB (shaded_triangle "layer2" pnt_a pnt_f pnt_b )) (make_jpg) (command "_.delay" 2000) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_5" pnt_d whole) (command "oops") (my_block_insert "WHOLE_5" '(9.0 -6.5) 0.4) (command "_.zoom" "E") (make_jpg) (make_jpg) (entdel AFB) (command "_.layer" "set" "layer2" "") (tri_along_line "layer2" pnt_a pnt_c n_sec n_speed pnt_b pnt_f 2) (make_jpg) (setq trig_CBF last_hatch) (entdel last_pline) (step_51_text) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_6" pnt_d whole) (command "oops") (my_block_insert "WHOLE_6" '(13.25 -6.5) 0.4) (command "_.zoom" "E") (make_jpg) (alert " Step 5: \nRotate Triangle CBF around point B\n ---> Triangle DBA") (rotate_ent trig_CBF pnt_b pnt_c -90. 25 25 1) (step_61_text) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_7" pnt_d whole) (command "oops") (my_block_insert "WHOLE_7" '(17.5 -6.5) 0.4) (command "_.zoom" "E") (make_jpg) (make_jpg) (entdel trig_CBF) (alert " Step 6: \nTriangle ABD ---> Triangle LBD") (command "_.layer" "set" "layer2" "") (tri_along_line "layer2" pnt_a pnt_l n_sec n_speed pnt_b pnt_d 2) (make_jpg) (command "_.layer" "set" "0" "") (make_point "layer8" 0 pnt_m "M" 1 chr_size) (step_71_text) (setq AFB (shaded_triangle "layer2" pnt_a pnt_f pnt_b )) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_8" pnt_d whole) (command "oops") (my_block_insert "WHOLE_8" '(21.75 -6.5) 0.4) (command "_.zoom" "E") (make_jpg) (alert " It is proved that\narea of AFB == area of LBD") (blink_layer "layer2" 100 3) (alert "We proved the following\n\nAFB = LBD--->AGFB = MBDL\n\nACK = LEC --->ACKH = LECM") (shaded_quad "layer2" pnt_b pnt_a pnt_g pnt_f ) (shaded_quad "layer2" pnt_b pnt_d pnt_l pnt_m ) (blink_layer "layer2" 100 3) (shaded_quad "layer3" pnt_a pnt_c pnt_k pnt_h ) (shaded_quad "layer3" pnt_l pnt_e pnt_c pnt_m ) (blink_layer "layer3" 100 3) (make_jpg) (make_jpg) (command "_.layer" "set" "0" "") (alert "We proved the following\n\nAGFB = MBDL\n\nACKH = LECM\n\nTherefore\n AGFB + ACKH = DECB") (make_jpg) (make_jpg) (reset_sysvar) );;;EUCLID_47_1 - - - main ;;; ;;; (defun setup_47_1() (setup_sysvar) (setvar "OSMODE" 0) (command "_.ucsicon" "off") (setq len_a 3. len_b 4. len_c 5. pnt_a '(1.8 2.4) pnt_b '(0 0) pnt_c '(5 0) pnt_d '(0 -5) pnt_e '(5 -5) pnt_f (point_off_line pnt_b pnt_a 0. (dtr 90.) len_a ) pnt_g (pld pnt_c pnt_a (+ len_a len_b)) pnt_h (pld pnt_b pnt_a (+ len_a len_b)) pnt_k (point_off_line pnt_c pnt_a 0. (dtr -90) len_b) pnt_l '(1.8 -5) pnt_m '(1.8 0) ) (command "_.pline" pnt_c pnt_a pnt_h pnt_k "_c") (command "_.pline" pnt_a pnt_b pnt_f pnt_g "_c") (command "_.pline" pnt_b pnt_c pnt_e pnt_d "_c") (command "_.pline" pnt_a pnt_b pnt_c "c") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 2 chr_size) (make_point "layer8" 0 pnt_b "B" 3 chr_size) (make_point "layer8" 0 pnt_c "C" 1 chr_size) (make_point "layer8" 0 pnt_d "D" 4 chr_size) (make_point "layer8" 0 pnt_e "E" 4 chr_size) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "layer8" 0 pnt_g "G" 2 chr_size) (make_point "layer8" 0 pnt_h "H" 1 chr_size) (make_point "layer8" 0 pnt_k "K" 1 chr_size) (make_point "layer8" 0 pnt_l "L" 4 chr_size) (command "_.point" '(24.5 8.0)) (command "_.point" '(24.5 -7.0)) ;;;zoom to the extent (command "_.zoom" "_EXTENT") (setq n_speed 75 n_sec 10) (setq t_pnt '(14.4 2.3) t_height 0.5 t_angle 0.) (command "_.rectangle" '(14.25 -1.8) '(25 3)) );setup_47_1 ;;; ;;;Texts in the text box ;;; (defun step_11_text() (command "_.text" t_pnt t_height t_angle "Step:1") (setq text_ent_1 (entlast)) (command "_.text" "" "move the triangle ACK to BCK") (setq text_ent_2 (entlast)) ) ;;; (defun step_21_text() (command "_.layer" "_set" "0" "") (entdel text_ent_1) (entdel text_ent_2) (command "_.text" t_pnt t_height t_angle "Step:2") (setq text_ent_1 (entlast)) (command "_.text" "" "Rotate triangle BCK about point C") (setq text_ent_2 (entlast)) (command "_.text" "" "until it matches Triangle ECA") (setq text_ent_3 (entlast)) ) ;;; (defun step_31_text() (command "_.layer" "_set" "0" "") (entdel text_ent_1) (entdel text_ent_2) (entdel text_ent_3) (command "_.text" t_pnt t_height t_angle "Step:3") (setq text_ent_1 (entlast)) (command "_.text" "" "move the triangle ACE to LEC") (setq text_ent_2 (entlast)) ) ;;; (defun step_41_text() (command "_.layer" "_set" "0" "") (entdel text_ent_1) (entdel text_ent_2) (command "_.text" t_pnt t_height t_angle "Step:4") (setq text_ent_1 (entlast)) (command "_.text" "" "move the triangle AFB to CFB") (setq text_ent_2 (entlast)) ) ;;; (defun step_51_text() (command "_.layer" "_set" "0" "") (entdel text_ent_1) (entdel text_ent_2) (command "_.text" t_pnt t_height t_angle "Step:5") (setq text_ent_1 (entlast)) (command "_.text" "" "Rotate triangle CBF about point B") (setq text_ent_2 (entlast)) (command "_.text" "" "until it matches Triangle DBA") (setq text_ent_3 (entlast)) ) ;;; (defun step_61_text() (command "_.layer" "_set" "0" "") (entdel text_ent_1) (entdel text_ent_2) (entdel text_ent_3) (command "_.text" t_pnt t_height t_angle "Step:6") (setq text_ent_1 (entlast)) (command "_.text" "" "move the triangle DBA to DBL") (setq text_ent_2 (entlast)) ) ;;; (defun step_71_text() (command "_.layer" "_set" "0" "") (entdel text_ent_1) (entdel text_ent_2) (command "_.text" t_pnt t_height t_angle "We have proved that") (command "_.text" "" "ABFG = BDLM") (command "_.text" "" "ACKH = MLEC") (command "_.text" "" "Therefore, ") (command "_.text" "" " BDEC = ABFG + ACKH") (command "_.text" "" " Q. E. D. ") ) ;;; ;;;*****************EUCLID_47_2******************************************************* ;;; (defun C:Euclid_47_2a() (setup_47_2) (alert "Step 1: Define point H on Line AC such that\nAH = BC = b\nThen HC = AD = a") (c:step1_2) (alert "Step 2: Compare Triangles DAH and HCG") (c:step2_2) (setq pnt_ad (mid_point pnt_a pnt_d) pnt_dh (mid_point pnt_d pnt_h) pnt_ah (mid_point pnt_a pnt_h) pnt_cg (mid_point pnt_c pnt_g) ) (mark_id pnt_ad "a" 3 chr_size) (mark_id pnt_ah "b" 4 chr_size) (mark_id pnt_dh "c" 1 chr_size) (mark_id pnt_cg "b" 1 chr_size) (alert "Step 3: Since AH = BC and HC = AD\n Triangle DAH = Triangle HCG") (c:step3_2) (alert "Step 4: Rotate Triangle DAH 90 degrees CCW\nuntil A matches E") (c:step4_2a) (alert "Step 5: Rotate Triangle HCG 270 degrees CCW\nuntil C matches F") (c:step5_2a) (c:step6_2) (alert "Final: It is proved \nHGDJ = ABDE + BCFG\n\n or c*c = a*a + b*b\n\n\tQ.E.D.") (reset_sysvar) );;;EUCLID_47_2a - - - main-2a ;;; ;;; (defun C:Euclid_47_2b() (setup_47_2) (make_jpg) (alert "Step 1: Define point H on Line AC \n\nsuch that AH = BC = b.\n\nThen HC = AD = a") (make_jpg) (c:step1_2) (make_jpg) (setq pnt_ad (mid_point pnt_a pnt_d) pnt_dh (mid_point pnt_d pnt_h) pnt_ah (mid_point pnt_a pnt_h) pnt_cg (mid_point pnt_c pnt_g) ) (mark_id pnt_ad "a" 3 chr_size) (mark_id pnt_ah "b" 4 chr_size) (mark_id pnt_dh "c" 1 chr_size) (mark_id pnt_cg "b" 1 chr_size) (make_jpg) (alert "Step 2:\n Compare Triangles DAH and HCG\n\nSince AH = BC = b\nand HC = AD = a\n\n DAH = HCG.") (make_jpg) ;;;shade polygon DHGFE by 45 deg by 0.2 inch cross hatch (command "_.pline" pnt_d pnt_h pnt_g pnt_f pnt_e "_cl") (setq pl_DHGFE (entlast)) (command "_.hatch" "_U" 45. 0.2 "_N" pl_DHGFE "") (make_jpg) ;(alert "Step 3: Since AH = BC and HC = AD\n Triangle DAH = Triangle HCG") (make_jpg) (c:step3_2) (make_jpg) (setq pnt_cr1 '(9.0 9.0) pnt_cr2 '(-0.5 -0.5)) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACGJD_1" pnt_a whole) (command "_.oops") (my_block_insert "ACGJD_1" '(15.0 5.) 0.75) (command "_.zoom" "_EXTENT") (make_jpg) (alert "Step 4: Move Triangle DAH along line HG\nuntil H matches G") (make_jpg) (c:step4_2b) (make_jpg) (alert "Step 5: Move Triangle HCG along line HD\nuntil H matches D") (c:step5_2b) (make_jpg) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACGJD_2" pnt_a whole) (command "_.oops") (my_block_insert "ACGJD_2" '(15.0 -3) 0.75) (command "_.zoom" "_EXTENT") (command "_.delay" 1000) (make_jpg) (c:step6_2) (make_jpg) (alert "Final:\n\n It is proved \n\nHGDJ = ABED + BCGF\n\n or c*c = a*a + b*b\n\n\tQ.E.D.") (textdisplay "c = a + b" '(8.6 5.4) 0.81 0.) (textdisplay "2 2 2" '(9.2 6.1) 0.45 0.) (make_jpg) (reset_sysvar) );;;EUCLID_47_2b - - - main-2b ;;; ;;; (defun C:Euclid_47_2c() (setup_47_2c) (make_jpg) (alert "Step 1:\n\n Shade 5 parts of the square DHGJ.") (setq trig_DHL (shaded_triangle "layer2" pnt_d pnt_h pnt_l) trig_HGK (shaded_triangle "layer3" pnt_h pnt_g pnt_k) trig_GJF (shaded_triangle "layer4" pnt_g pnt_j pnt_f) trig_JDE (shaded_triangle "layer5" pnt_j pnt_d pnt_e) quad_KFEL (shaded_quad "layer6" pnt_k pnt_f pnt_e pnt_l) ) (make_jpg) (setq pnt_cr1 '(9.0 9.0) pnt_cr2 '(-0.5 -0.5)) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACGJD_1" pnt_a whole) (command "_.oops") (my_block_insert "ACGJD_1" '(15.0 5.) 0.75) (command "_.zoom" "E") (make_jpg) (alert "Step 2:\n\nMove Triangle GJF until GJ aligns with HD.") (command "_.layer" "_set" "layer8" "") (move_ent trig_GJF pnt_g pnt_h 100 6 1 "0") (command "_.layer" "_set" "0" "") (make_point "layer8" 0 pnt_a "A" 4 chr_size) (make_jpg) (alert "Step 3:\n\nMove Triangle JDE until JD aligns with GH.") (command "_.layer" "_set" "layer8" "") (move_ent trig_JDE pnt_j pnt_g 100 6 1 "0") (command "_.layer" "_set" "0" "") (make_point "layer8" 0 pnt_c "C" 4 chr_size) (make_line_1 "0" 0 pnt_b pnt_f) (make_point "layer8" 0 pnt_b "B" 1 chr_size) (make_jpg) (alert "Step 4:\n\n AB = a") (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACGJD_2" pnt_a whole) (command "_.oops") (my_block_insert "ACGJD_2" '(15.0 -3) 0.75) (command "_.zoom" "_EXTENT") (command "_.delay" 1000) (make_jpg) (alert "Final:\n\n It is proved \n\nHGJD = ABED + BCGF\n\n or c*c = a*a + b*b\n\n\tQ.E.D.") (textdisplay "c = a + b" '(8.6 5.4) 0.81 0.) (textdisplay "2 2 2" '(9.2 6.1) 0.45 0.) (make_jpg) (make_jpg) (reset_sysvar) );;;EUCLID_47_2c - - - main-2c ;;; ;;; (defun C:Euclid_47_2d() (setup_47_2d) (make_jpg) (alert "Step 1: Shade the square ABED \n\n(area= a*a)") (setq quad_DLHO (shaded_quad "layer3" pnt_d pnt_l pnt_h pnt_o) quad_AMHL (shaded_quad "layer4" pnt_a pnt_m pnt_h pnt_l) quad_BNHM (shaded_quad "layer5" pnt_b pnt_n pnt_h pnt_m) quad_EOHN (shaded_quad "layer6" pnt_e pnt_o pnt_h pnt_n) ) (make_jpg) (alert "Step 2:\n Shade the square BCFG \n\n(area = b*b)" ) ;;;shade polygon DHGFE by 45 deg by 0.2 inch cross hatch (command "_.pline" pnt_b pnt_c pnt_g pnt_f "cl") (setq quad_BCGF (entlast)) (command "_.hatch" "_U" 45. 0.2 "_N" quad_BCGF "") (make_jpg) ;(alert "Step 3: Since AH = BC and HC = AD\n Triangle DAH = Triangle HCG") (setq pnt_cr1 '(9.0 9.0) pnt_cr2 '(-0.5 -0.5)) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACGJD_1" pnt_a whole) (command "_.oops") (my_block_insert "ACGJD_1" '(15.0 5.) 0.75) (command "_.zoom" "_EXTENT") (make_jpg) (alert "Step 3: Move Quad DLHO until Point H reaches point J") (move_ent quad_DLHO pnt_h pnt_j 100 6 1 "0") (make_jpg) (alert "Step 4: Move Quad AMHL until Point H reaches point J") (move_ent quad_AMHL pnt_h pnt_k 100 6 1 "0") (make_jpg) (alert "Step 5: Move Quad EOHN until Point H reaches point J") (move_ent quad_EOHN pnt_h pnt_i 100 6 1 "0") (make_jpg) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACGJD_2" pnt_a whole) (command "_.oops") (my_block_insert "ACGJD_2" '(15.0 -3) 0.75) (command "_.zoom" "_EXTENT") (command "_.delay" 1000) (make_jpg) (alert "Final:\n\n It is proved \n\nHIJK = ABED + BCGF\n\n or c*c = a*a + b*b\n\n\tQ.E.D.") (textdisplay "c = a + b" '(8.6 5.4) 0.81 0.) (textdisplay "2 2 2" '(9.2 6.1) 0.45 0.) (make_jpg) (make_jpg) (reset_sysvar) );;;EUCLID_47_2d - - - main-2d ;;; ;;; (defun setup_47_2() (setup_sysvar) (setq len_a 5. ;(getreal "\nLength A= ") len_b 3. ;(getreal "\nLength B= ") len_ab (+ len_a len_b) len_ab2 (* 3. len_ab) len_min (* 0.5 (min len_a len_b)) ) (setvar "OSMODE" 0) (command "_.ucsicon" "_off") (setq pnt_a '(0 0) pnt_b (list len_a 0) pnt_c (list len_ab 0) pnt_d (list 0 len_a) pnt_e (list len_a len_a) pnt_f (list len_a len_b) pnt_g (list len_ab len_b) pnt_r1 (list len_ab2 (+ len_ab 1.25)) pnt_r2 (list len_ab2 (- (- len_min ) 2.0) ) ) (command "_.layer" "_set" "layer8" "") (command "_.pline" pnt_a pnt_b pnt_e pnt_d "_c") (command "_.pline" pnt_b pnt_c pnt_g pnt_f "_c") (command "_.layer" "_set" "0" "") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 4 chr_size) (make_point "layer8" 0 pnt_b "B" 4 chr_size) (make_point "layer8" 0 pnt_c "C" 4 chr_size) (make_point "0" 0 pnt_d "D" 3 chr_size) (make_point "layer8" 0 pnt_e "E" 2 chr_size) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "0" 0 pnt_g "G" 1 chr_size) ;;;zoom to the extent (command "_.point" pnt_r1) (command "_.point" pnt_r2) (command "_.zoom" "_EXTENT") ;(command "_.zoom" "scale" 0.65) (setq n_speed 100 n_sec 8) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) );setup_47_2 ;;; ;;;setup for case c (defun setup_47_2c() (setup_sysvar) (setq len_a 5. ;(getreal "\nLength A= ") len_b 3. ;(getreal "\nLength B= ") len_ab (+ len_a len_b) len_ab2 (* 3. len_ab) len_min (* 0.5 (min len_a len_b)) ) (setvar "OSMODE" 0) (command "_.ucsicon" "_off") (setq pnt_a '(0 0) pnt_b (list len_a 0) pnt_c (list len_ab 0) pnt_d (list 0 len_a) pnt_e (list len_a len_a) pnt_f (list len_a len_b) pnt_g (list len_ab len_b) pnt_h (list len_b 0) pnt_l (list len_b len_a) pnt_k (list len_b len_b) pnt_r1 (list len_ab2 (+ len_ab 3.5)) pnt_r2 (list len_ab2 (- (- len_min ) 2.0) ) ) (setq pnt_j (list len_a (+ len_a len_b)) ) (command "_.layer" "_set" "layer8" "") (command "_.pline" pnt_d pnt_h pnt_g pnt_j "_c") (command "_.pline" pnt_d pnt_a pnt_c pnt_g "") (make_line_1 "layer8" 0 pnt_d pnt_e) (make_line_1 "layer8" 0 pnt_h pnt_l) (make_line_1 "layer8" 0 pnt_g pnt_k) (make_line_1 "layer8" 0 pnt_j pnt_f) (command "_.layer" "_set" "0" "") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5) (regapp "my_point") (make_point "0" 0 pnt_d "D" 3 chr_size) (make_point "layer8" 0 pnt_e "E" 2 chr_size) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "0" 0 pnt_g "G" 1 chr_size) (make_point "layer8" 0 pnt_h "H" 4 chr_size) (make_point "layer8" 0 pnt_j "J" 2 chr_size) (make_point "layer8" 0 pnt_k "K" 2 chr_size) (make_point "layer8" 0 pnt_l "L" 2 chr_size) ;;;zoom to the extent (command "_.point" pnt_r1) (command "_.point" pnt_r2) ;;;identify the side length a,b,c (mark_id (mid_point pnt_a pnt_d) "a" 3 chr_size) (mark_id (mid_point pnt_a pnt_h) "b" 4 chr_size) (mark_id (mid_point pnt_d pnt_h) "c" 3 chr_size) (mark_id (mid_point pnt_c pnt_g) "b" 1 chr_size) (mark_id (mid_point pnt_f pnt_g) "b" 2 chr_size) (mark_id (mid_point pnt_g pnt_j) "c" 1 chr_size) (mark_id (mid_point pnt_c pnt_h) "a" 4 chr_size) (mark_id (mid_point pnt_d pnt_j) "c" 3 chr_size) (mark_id (mid_point pnt_g pnt_h) "c" 4 chr_size) (command "_.zoom" "_EXTENT") ;(command "_.zoom" "_scale" 0.65) (setq n_speed 100 n_sec 8) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) );setup_47_2c ;;; ;;; (defun setup_47_2d() (setup_sysvar) (setq len_a 5. ;(getreal "\nLength A= ") len_b 3. ;(getreal "\nLength B= ") len_ab (+ len_a len_b) len_ab2 (* 3. len_ab) len_min (* 0.5 (min len_a len_b)) half_a (* 0.5 len_a) half_3a (* 1.5 len_a) ) (setvar "OSMODE" 0) ;(set_layer) (command "_.ucsicon" "_off") (setq pnt_a '(0 0) pnt_b (list len_a 0) pnt_c (list len_ab 0) pnt_d (list 0 len_a) pnt_e (list len_a len_a) pnt_f (list len_a len_b) pnt_g (list len_ab len_b) pnt_h (list half_a half_a) pnt_i (list (+ len_b half_a) (- half_a)) pnt_j (list (+ len_b half_3a) (- len_b half_a)) pnt_k (list half_3a (+ len_b half_a)) pnt_l (inters pnt_a pnt_d pnt_h pnt_k nil) pnt_m (inters pnt_a pnt_b pnt_h pnt_i nil) pnt_n (inters pnt_b pnt_e pnt_h pnt_k nil) pnt_o (inters pnt_d pnt_e pnt_h pnt_i nil) pnt_p (inters pnt_f pnt_g pnt_k pnt_j nil) pnt_q (inters pnt_c pnt_g pnt_i pnt_j nil) pnt_r1 (list len_ab2 (+ len_ab 1.25)) pnt_r2 (list len_ab2 (- (- len_min ) 2.0) ) ) (command "_.layer" "_set" "layer8" "") (command "_.pline" pnt_a pnt_b pnt_e pnt_d "_c") (command "_.pline" pnt_b pnt_c pnt_g pnt_f "_c") (command "_.layer" "_set" "0" "") (command "_.layer" "_set" "layer2" "") (command "_.pline" pnt_l pnt_k pnt_j pnt_i pnt_o "") (command "_.layer" "_set" "0" "") (make_line_1 "0" 8 pnt_g pnt_p) (make_line_1 "0" 8 pnt_c pnt_q) ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 4 chr_size) (make_point "layer8" 0 pnt_b "B" 4 chr_size) (make_point "layer8" 0 pnt_c "C" 1 chr_size) (make_point "0" 0 pnt_d "D" 3 chr_size) (make_point "layer8" 0 pnt_e "E" 2 chr_size) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "0" 0 pnt_g "G" 2 chr_size) (make_point "layer8" 0 pnt_h "H" 2 chr_size) (make_point "layer8" 0 pnt_i "I" 4 chr_size) (make_point "layer8" 0 pnt_j "J" 1 chr_size) (make_point "layer8" 0 pnt_k "K" 1 chr_size) (make_point "layer8" 0 pnt_l "L" 3 chr_size) (make_point "layer8" 0 pnt_m "M" 4 chr_size) (make_point "layer8" 0 pnt_n "N" 1 chr_size) (make_point "layer8" 0 pnt_o "O" 2 chr_size) (make_point "layer8" 0 pnt_p "P" 1 chr_size) (make_point "layer8" 0 pnt_q "Q" 4 chr_size) ;;;zoom to the extent (command "_.point" pnt_r1) (command "_.point" pnt_r2) (command "_.zoom" "_EXTENT") ;(command "_.zoom" "_scale" 0.65) (setq n_speed 100 n_sec 8) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) );setup_47_2d ;;; ;;; (defun C:step1_2() (setq pnt_h (list len_b 0)) (make_point "layer8" 0 pnt_h "H" 4 chr_size) (slow_line n_speed "0" 8 pnt_d pnt_h) (slow_line n_speed "0" 8 pnt_h pnt_g) );;;step1_2 ;;; ;;; (defun C:step3_2() (command "_.layer" "_set" "layer3" "") (command "_.pline" pnt_a pnt_h pnt_d "c") (setq pln_tr1 (entlast)) (command "_.hatch" "_solid" pln_tr1 "") (make_jpg) (setq hat_tr1 (entlast)) (command "_.layer" "_set" "0" "") (command "_.layer" "_set" "layer4" "") (command "_.pline" pnt_h pnt_c pnt_g "_c") (setq pln_tr2 (entlast)) (command "_.hatch" "_solid" pln_tr2 "") (make_jpg) (setq hat_tr2 (entlast)) (command "_.layer" "_set" "0" "") );;; ;;; (defun C:step4_2a() (command "_.layer" "_set" "layer8" "") (setq pnt_at pnt_a n_repeat 6 rot_speed 75 total_rot_angle 90. rot_step (/ total_rot_angle n_repeat) cur_angle 270. ) (repeat n_repeat (slow_arc rot_speed "0" 1 pnt_d pnt_at rot_step 0) (command "_.rotate" hat_tr1 "" pnt_d rot_step) (setq pnt_at (polar pnt_d (dtr (setq cur_angle (+ cur_angle rot_step))) len_a)) ) (command "_.layer" "_set" "0" "") );;; ;;; (defun C:step4_2b() (command "_.layer" "_set" "layer8" "") (move_ent hat_tr1 pnt_h pnt_g 100 6 1 "0") (command "_.layer" "_set" "0" "") );;; ;;; (defun C:step5_2a() (command "_.layer" "_set" "layer8" "") (setq pnt_ct pnt_c n_repeat 6 rot_speed 75 total_rot_angle 270. rot_step (/ total_rot_angle n_repeat) cur_angle -90. ) (repeat n_repeat (slow_arc rot_speed "0" 1 pnt_g pnt_ct rot_step 0) (command "_.rotate" hat_tr2 "" pnt_g rot_step) (setq pnt_ct (polar pnt_g (dtr (setq cur_angle (+ cur_angle rot_step))) len_b)) ) (command "_.layer" "_set" "0" "") (setq pnt_j (list len_a (+ len_a len_b)) ) (make_point "layer8" 0 pnt_j "J" 2 chr_size) );;; ;;; (defun C:step5_2b() (command "_.layer" "_set" "layer8" "") (move_ent hat_tr2 pnt_h pnt_d 100 6 1 "0") (command "_.layer" "_set" "0" "") (setq pnt_j (list len_a (+ len_a len_b)) ) (make_point "layer8" 0 pnt_j "J" 2 chr_size) );;; ;;; (defun C:step6_2() (command "_.layer" "_set" "layer4" "") (command "_.hatch" "_solid" pln_tr2 "") (command "_.layer" "_set" "0" "") (make_jpg) (command "_.layer" "_set" "layer3" "") (command "_.hatch" "_solid" pln_tr1 "") (command "_.layer" "_set" "0" "") (make_jpg) );;; ;;; ;;;*****************EUCLID_47_3******************************************************* ;;; (defun C:Euclid_47_3() (setup_47_3) (make_jpg) (alert "STEP 0: \nExtend FG and KH and the intersection point is N") (setq pnt_n (inters pnt_f pnt_g pnt_k pnt_h nil)) (make_point "layer8" 0 pnt_n "N" 2 chr_size) (make_line_1 "layer8" 8 pnt_g pnt_n) (make_line_1 "layer8" 8 pnt_h pnt_n) (make_line_1 "layer8" 8 pnt_a pnt_n) (make_line_1 "layer8" 8 pnt_a pnt_l) (command "_.zoom" "e") (make_jpg) (make_jpg) (alert "STEP 0: \nGet intersection of EC and NK--point P") (setq pnt_p (inters pnt_e pnt_c pnt_k pnt_n nil)) (make_line_1 "layer8" 8 pnt_c pnt_p) (make_point "layer8" 0 pnt_p "P" 2 chr_size) (make_jpg) (alert "STEP 0: \nGet intersection of DB and FN--point Q") (setq pnt_q (inters pnt_b pnt_d pnt_f pnt_n nil)) (make_line_1 "layer8" 8 pnt_b pnt_q) (make_point "layer8" 0 pnt_q "Q" 3 chr_size) (make_jpg) ;;;copy ACKH & BAGF to the right (setq ACKH (shaded_quad "layer3" pnt_a pnt_c pnt_k pnt_h) BAGF (shaded_quad "layer2" pnt_b pnt_a pnt_g pnt_f) ) (make_jpg) (setq pnt_cr1 (list (+ (car pnt_k) chr_size) (+ (cadr pnt_n) chr_size)) pnt_cr2 (list (- (car pnt_f) chr_size) (- (cadr pnt_d) chr_size))) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_1" pnt_d whole) (command "_.oops") (my_block_insert "WHOLE_1" '(12.0 1.5) 0.4) (command "_.zoom" "_EXTENT") (make_jpg) (make_jpg) (entdel ACKH) (entdel BAGF) (make_jpg) (alert "Step 1: \nQuadrilateral ACKH ---> Quadrilateral ACPN") (command "_.layer" "_set" "layer3" "") (quad_along_line "layer3" pnt_h pnt_n n_sec n_speed pnt_c pnt_a 1 len_b) (command "_.layer" "_set" "0" "") (setq right_hatch last_hatch) (make_jpg) (alert "Step 2: \nQuadrilateral BAGF ---> Quadrilateral BANQ") (command "_.layer" "set" "layer2" "") (quad_along_line "layer3" pnt_g pnt_n n_sec n_speed pnt_b pnt_a 1 len_a) (command "_.layer" "set" "0" "") (setq left_hatch last_hatch) (make_jpg) ;;;copy ACPN & BANQ to the right (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_2" pnt_d whole) (command "oops") (my_block_insert "WHOLE_2" '(17.0 1.5) 0.4) (command "_.zoom" "E") (make_jpg) (alert "Step 3: \nSlide down Quadrilateral ACPN") (move_ent right_hatch pnt_n pnt_a 100 6 1 "0") (make_jpg) (alert "Step 4: \nSlide down Quadrilateral BANQ") (move_ent left_hatch pnt_n pnt_a 100 6 1 "0") (make_jpg) ;;;copy WHOLE_3 to the right (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_3" pnt_d whole) (command "oops") (my_block_insert "WHOLE_3" '(22.0 1.5) 0.4) (command "_.zoom" "E") (make_jpg) (alert "Step 5: \nSlide down the right quadrilateral ") (entdel right_hatch) (command "_.layer" "set" "layer3" "") (quad_along_line "layer3" pnt_a pnt_m n_sec n_speed pnt_e pnt_c 1 (- len_c)) (command "_.layer" "set" "0" "") (setq right_hatch last_hatch) (make_jpg) (alert "Step 6: \nSlide down the left quadrilateral") (entdel left_hatch) (command "_.layer" "set" "layer2" "") (quad_along_line "layer3" pnt_a pnt_m n_sec n_speed pnt_d pnt_b 1 (- len_c)) (command "_.layer" "set" "0" "") (setq left_hatch last_hatch) (make_jpg) ;;;copy WHOLE_4 to the right (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_4" pnt_d whole) (command "oops") (my_block_insert "WHOLE_4" '(12.0 -6.0) 0.4) (command "_.zoom" "E") (make_jpg) (alert "We proved the following\n\nAFB = LBD--->AGFB = MBDL") (setq quad_ABFG (shaded_quad "layer2" pnt_a pnt_b pnt_f pnt_g)) (blink_layer "layer2" 100 3) (make_jpg) (alert "We proved the following\n\nACK = LEC --->ACKH = LECM") (setq quad_ACHK (shaded_quad "layer3" pnt_a pnt_c pnt_k pnt_h)) (blink_layer "layer3" 100 3) ;(c:step7_3) (make_jpg) ;;;copy WHOLE_5 to the right (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_5" pnt_d whole) (command "oops") (my_block_insert "WHOLE_5" '(17.0 -6.0) 0.4) (command "_.zoom" "E") (make_jpg) (alert "We proved the following\n\nAGFB = MBDL\n\nACKH = LECM\n\nTherefore\n AGFB + ACKH = DECB") (make_jpg) (make_jpg) (reset_sysvar) );;;EUCLID_47_3 - - - main ;;; ;;; (defun setup_47_3() (setup_sysvar) (setvar "OSMODE" 0) (command "_.ucsicon" "off") (setq len_a 3. len_b 4. len_c 5. pnt_a '(1.8 2.4) pnt_b '(0 0) pnt_c '(5 0) pnt_d '(0 -5) pnt_e '(5 -5) pnt_f (point_off_line pnt_b pnt_a 0. (dtr 90.) len_a ) pnt_g (pld pnt_c pnt_a (+ len_a len_b)) pnt_h (pld pnt_b pnt_a (+ len_a len_b)) pnt_k (point_off_line pnt_c pnt_a 0. (dtr -90) len_b) pnt_l '(1.8 -5) pnt_m '(1.8 0) ) (command "_.pline" pnt_c pnt_a pnt_h pnt_k "c") (command "_.pline" pnt_a pnt_b pnt_f pnt_g "c") (command "_.pline" pnt_b pnt_c pnt_e pnt_d "c") (command "_.pline" pnt_a pnt_b pnt_c "c") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 2 chr_size) (make_point "layer8" 0 pnt_b "B" 3 chr_size) (make_point "layer8" 0 pnt_c "C" 1 chr_size) (make_point "layer8" 0 pnt_d "D" 4 chr_size) (make_point "layer8" 0 pnt_e "E" 4 chr_size) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "layer8" 0 pnt_g "G" 2 chr_size) (make_point "layer8" 0 pnt_h "H" 1 chr_size) (make_point "layer8" 0 pnt_k "K" 1 chr_size) (make_point "layer8" 0 pnt_l "L" 4 chr_size) (make_point "layer8" 0 pnt_m "M" 1 chr_size) (command "_.point" '(23 6)) (command "_.point" '(23 -5.8)) ;;;zoom to the extent (command "_.zoom" "E") (setq n_speed 75 n_sec 10) );setup_47_3 ;;; ;;; ;;;*****************EUCLID_47_4*******Pappus of Alexandria********************************* ;;; (defun C:Euclid_47_4() (setup_47_4) (make_jpg) ;;;copy ACKH & BAGF to the right (setq pnt_cr1 (list (car pnt_h) (cadr pnt_n)) pnt_cr2 (list (car pnt_f) (cadr pnt_d))) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_1" pnt_d whole) (command "oops") (my_block_insert "WHOLE_1" '(12.0 1.5) 0.4) (command "_.zoom" "E") (make_jpg) (entdel ACHK) (entdel BAGF) (alert "Step 1: \nQuadrilateral ACKH ---> Quadrilateral ACPN") (command "_.layer" "set" "layer3" "") (quad_along_line "layer3" pnt_k pnt_n n_sec n_speed pnt_c pnt_a 1 len_b) (command "_.layer" "set" "0" "") (setq right_hatch last_hatch pl_achk last_pline) (make_jpg) (alert "Step 2: \nQuadrilateral BAGF ---> Quadrilateral BANQ") (command "_.layer" "set" "layer2" "") (quad_along_line "layer3" pnt_g pnt_n n_sec n_speed pnt_b pnt_a 1 len_a) (command "_.layer" "set" "0" "") (setq left_hatch last_hatch pl_bagf last_pline) (make_jpg) ;;;copy ACPN & BANQ to the right (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_2" pnt_d whole) (command "oops") (my_block_insert "WHOLE_2" '(17.0 1.5) 0.4) (command "_.zoom" "E") (make_jpg) (alert "Step 3: \nSlide down Quadrilateral ACPN") (move_ent right_hatch pnt_n pnt_a 100 6 1 "0") (make_jpg) (alert "Step 4: \nSlide down Quadrilateral BANQ") (move_ent left_hatch pnt_n pnt_a 100 6 1 "0") (make_jpg) ;;;copy WHOLE_3 to the right (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_3" pnt_d whole) (command "oops") (my_block_insert "WHOLE_3" '(22.0 1.5) 0.4) (command "_.zoom" "E") (make_jpg) (alert "Step 5: \nSlide down the right quadrilateral ") (entdel right_hatch) (command "_.layer" "set" "layer3" "") (quad_along_line "layer3" pnt_a pnt_l n_sec n_speed pnt_e pnt_c 1 (- len_na)) (command "_.layer" "set" "0" "") (setq right_hatch last_hatch pl_mecl last_pline) (make_jpg) (alert "Step 6: \nSlide down the left quadrilateral") (entdel left_hatch) (command "_.layer" "set" "layer2" "") (quad_along_line "layer3" pnt_a pnt_l n_sec n_speed pnt_d pnt_b 1 (- len_na)) (command "_.layer" "set" "0" "") (setq left_hatch last_hatch pl_dmlb last_pline) (make_jpg) ;;;copy WHOLE_4 to the right (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_4" pnt_d whole) (command "oops") (my_block_insert "WHOLE_4" '(12.0 -6.0) 0.4) (command "_.zoom" "E") (make_jpg) (alert "We proved the following\n\nAFB = LBD--->AGFB = MBDL") (setq quad_ABFG (shaded_quad "layer2" pnt_a pnt_b pnt_f pnt_g)) (make_jpg) (blink_layer "layer2" 100 3) (alert "We proved the following\n\nACK = LEC --->ACKH = LECM") (setq quad_ACHK (shaded_quad "layer3" pnt_a pnt_c pnt_h pnt_k)) (make_jpg) (blink_layer "layer3" 100 3) ;;;copy WHOLE_5 to the right (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_5" pnt_d whole) (command "oops") (my_block_insert "WHOLE_5" '(17.0 -6.0) 0.4) (command "_.zoom" "E") (make_jpg) (alert "We proved the following\n\nAGFB = MBDL\n\nACKH = LECM\n\nTherefore\n AGFB + ACKH = DECB") (make_jpg) (reset_sysvar) );;;EUCLID_47_4 - - - main ;;; ;;; (defun setup_47_4() (setup_sysvar) (setvar "OSMODE" 0) (command "_.ucsicon" "off") (setq pnt_a '(1.8 2.4) pnt_b '(0 0) pnt_c '(7 0) len_a (distance pnt_a pnt_b) len_b (distance pnt_a pnt_c) len_c (distance pnt_b pnt_c) ) (make_line_1 "0" 0 pnt_c pnt_a) (setq line_ac (entlast)) (make_line_1 "0" 0 pnt_b pnt_a) (setq line_ab (entlast)) (make_line_1 "0" 0 pnt_b pnt_c) (setq line_bc (entlast)) ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 2 chr_size) (make_point "layer8" 0 pnt_b "B" 3 chr_size) (make_point "layer8" 0 pnt_c "C" 1 chr_size) (command "_.point" '(23 6)) (command "_.point" '(23 -5.8)) (command "_.point" '(-3 0)) (command "_.text" '(-1.5 -5.5) chr_size 0. "Generalized Pythagorean Theorem") (command "_.text" "" "Proof by : Pappus of Alexandria") ;;;zoom to the extent (command "_.zoom" "E") (setq n_speed 75 n_sec 10) (alert "\nmake a parallelogram with AC as a base") (make_parallelogram line_ac pnt_c pnt_a 3) (setq pnt_h new_pnt1 pnt_k new_pnt2) (make_point "layer8" 0 pnt_h "H" 2 chr_size) (make_point "layer8" 0 pnt_k "K"2 chr_size) (make_jpg) (alert "\nmake a parallelogram with AB as a base") (make_parallelogram line_ab pnt_b pnt_a 2) (setq pnt_f new_pnt1 pnt_g new_pnt2) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "layer8" 0 pnt_g "G" 2 chr_size) (make_jpg) (alert "\nextend FG and HK . Intersection is point N") (setq pnt_n (inters pnt_f pnt_g pnt_h pnt_k nil)) (make_point "layer8" 0 pnt_n "N" 2 chr_size) (make_line_1 "0" 8 pnt_n pnt_a) (setq line_na (entlast)) (make_line_1 "0" 8 pnt_g pnt_n) (make_line_1 "0" 8 pnt_n pnt_k) (make_jpg) (alert "\nExtend NA to line SC. Intersection is L") (setq pnt_l (inters pnt_n pnt_a pnt_b pnt_c nil)) (make_point "layer8" 0 pnt_l "L" 1 chr_size) (make_line_1 "0" 8 pnt_a pnt_l) (make_jpg) (alert "\nextend line NL so that NM = NA") (command "_.copy" line_na "" pnt_n pnt_l) (setq line_lm (entlast)) (setq pnt_m (cdr (assoc 11 (entget line_lm)))) (make_point "layer8" 0 pnt_m "M" 4 chr_size) (make_jpg) (alert "\nDraw a line from B parallel to LM") (command "_.copy" line_lm "" pnt_l pnt_b) (setq pnt_d (cdr (assoc 11 (entget (setq line_bd (entlast)))))) (make_jpg) (alert "\nDraw a line from C parallel to LM") (command "_.copy" line_lm "" pnt_l pnt_c) (setq pnt_e (cdr (assoc 11 (entget (setq line_ce (entlast)))))) (command "_.pline" pnt_b pnt_c pnt_e pnt_d "c") (entdel line_bd) (entdel line_ce) (make_point "layer8" 0 pnt_d "D" 4 chr_size) (make_point "layer8" 0 pnt_e "E" 4 chr_size) (setq len_na (distance pnt_n pnt_a)) (make_jpg) (setq ACHK (shaded_quad "layer3" pnt_a pnt_c pnt_h pnt_k) BAGF (shaded_quad "layer2" pnt_b pnt_a pnt_g pnt_f) ) (make_jpg) (make_jpg) );setup_47_4 ;;; ;;; (defun make_parallelogram(ref_line ref_pnt1 ref_pnt2 ncolor) (command "_.copy" ref_line "" ref_pnt1 pause) (setq new_line (entlast)) (setq new_pnt1 (cdr (assoc 10 (entget new_line))) new_pnt2 (cdr (assoc 11 (entget new_line))) ) (command "_.pline" ref_pnt1 ref_pnt2 new_pnt2 new_pnt1 "c") ) ;;; ;;; (defun c:check_result() (command "area" "O" pl_achk) (command "area" "O" pl_mecl) (command "area" "O" pl_bagf) (command "area" "O" pl_dmlb) );check_area ;;;*********************************************************************************** ;;; Proof by Leonardo Da Vinci ;;;*****************EUCLID_47_5******************************************************* ;;; (defun C:Euclid_47_5() (setup_47_5) (make_jpg) (make_jpg) (alert "Step 1:\n\nWe will show \n\nthat the area of FBCK is equal to FGHK") (shaded_triangle "layer4" pnt_f pnt_g pnt_a) (make_jpg) (command "_.delay" 500) (shaded_triangle "layer5" pnt_g pnt_a pnt_h) (make_jpg) (command "_.delay" 500) (shaded_triangle "layer6" pnt_a pnt_h pnt_k) (make_jpg) (command "_.delay" 1500) (shaded_triangle "layer4" pnt_f pnt_b pnt_a) (make_jpg) (command "_.delay" 500) (shaded_triangle "layer5" pnt_b pnt_a pnt_c) (make_jpg) (command "_.delay" 500) (shaded_triangle "layer6" pnt_a pnt_c pnt_k) (make_jpg) (make_line_1 "0" 0 pnt_f pnt_k) (make_jpg) (shaded_triangle "layer5" pnt_d pnt_l pnt_e) (make_jpg) (command "_.delay" 2500) (alert "Step 2:Therefore\n\narea of FBCKHG is \n\ntwice that of FBCK") (setq pnt_ll '(-2.93 0.15) pnt_ur '(8.0 6.1)) (setq whole (ssget "C" pnt_ur pnt_ll)) (my_block_def "FBCKHG" pnt_b whole) (command "oops") (my_block_insert "FBCKHG" '(18.0 0.) 1.0) (command "_.zoom" "E") (make_jpg) (alert "Step 4: \n\nWe will show \n\nthat quadrilateral FBCK is equal to ABDL") (setq quad_FBCK1 (shaded_quad "layer2" pnt_f pnt_b pnt_c pnt_k) ) (make_jpg) (command "_.delay" 1500) (rotate_ent quad_FBCK1 pnt_b pnt_c -90. 25 25 1) (make_jpg) (make_jpg) (alert "Step 5: \n\nquadrilateral FBCK is equal to LECA") (setq quad_FBCK2 (shaded_quad "layer3" pnt_f pnt_b pnt_c pnt_k) ) (make_jpg) (make_jpg) (command "_.delay" 1500) (rotate_ent quad_FBCK2 pnt_c pnt_b 90. 25 25 1) (make_jpg) (make_jpg) (alert "Step 6:Thewrefore\n\narea of ABDLEC is \n\ntwice that of FBCK.") (setq pnt_ll '(-1.1 -8.2) pnt_ur '(6.14 3.2)) (setq whole (ssget "W" pnt_ll pnt_ur)) (my_block_def "ABDLEC" pnt_b whole) (command "oops") (my_block_insert "ABDLEC" '(11.0 0.) 1.0) (command "_.zoom" "E") (make_jpg) (make_jpg) (make_jpg) (alert "Step 7:\n\nTherefore\n\n\n FBCKHG = ABDLEC") (alert "Step 8:\n\nFBCKHG = FBAG + ACKH \n\n+ 2 Triangles(Blue)") (alert "Step 9:\n\nABDLEC = BDEC \n\n+ 2 Triangles(Blue)") (alert "Step 10: Therefore\n\n\nBDEC = FBAG + ACKH\n\n\n\t Q. E. D.") (reset_sysvar) );;;EUCLID_47_5 - - - main ;;; ;;; (defun setup_47_5() (setup_sysvar) (setvar "OSMODE" 0) (command "_.ucsicon" "off") (setq len_a 3. len_b 4. len_c 5. pnt_a '(1.8 2.4) pnt_b '(0 0) pnt_c '(5 0) pnt_d '(0 -5) pnt_e '(5 -5) pnt_f (point_off_line pnt_b pnt_a 0. (dtr 90.) len_a ) pnt_g (pld pnt_c pnt_a (+ len_a len_b)) pnt_h (pld pnt_b pnt_a (+ len_a len_b)) pnt_k (point_off_line pnt_c pnt_a 0. (dtr -90) len_b) pnt_l '(3.2 -7.4) pnt_m '(1.8 0) pnt_o '(2.5 -2.5) ) (command "_.pline" pnt_c pnt_a pnt_h pnt_k "c") (command "_.pline" pnt_a pnt_b pnt_f pnt_g "c") (command "_.pline" pnt_b pnt_c pnt_e pnt_d "c") (command "_.pline" pnt_a pnt_b pnt_c "c") (command "_.line" pnt_d pnt_l pnt_e "") (command "_.pline" pnt_f pnt_g pnt_h pnt_k "c") (command "_.line" pnt_b pnt_o pnt_c "") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 2 chr_size) (make_point "layer8" 0 pnt_b "B" 3 chr_size) (make_point "layer8" 0 pnt_c "C" 1 chr_size) (make_point "layer8" 0 pnt_d "D" 3 chr_size) (make_point "layer8" 0 pnt_e "E" 4 chr_size) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "layer8" 0 pnt_g "G" 2 chr_size) (make_point "layer8" 0 pnt_h "H" 1 chr_size) (make_point "layer8" 0 pnt_k "K" 1 chr_size) (make_point "layer8" 0 pnt_l "L" 4 chr_size) (make_point "layer8" 0 pnt_o "O" 1 chr_size) (command "_.point" '(23 6)) (command "_.point" '(23 -5.8)) (setq text_loc1 '(8 6) text_loc2 '(8 5.4)) ;;;zoom to the extent (textdisplay "Proof By :" text_loc1 chr_size 0.) (textdisplay "Leonardo Da Vinci" text_loc2 chr_size 0.) (command "_.zoom" "E") (setq n_speed 75 n_sec 10) (setq t_pnt '(11.4 2.3) t_height 0.5 t_angle 0.) );setup_47_5 ;;; ;;;*****************EUCLID_47_6******************************************************* ;;; (defun C:Euclid_47_6() (setup_47_6) (make_jpg) (make_jpg) (alert "Step 1: \nThe areas of these triangles \n are the same") (setq trig_ABC (shaded_triangle "layer5" pnt_a pnt_b pnt_c) trig_KEC (shaded_triangle "layer5" pnt_k pnt_e pnt_c) trig_IDE (shaded_triangle "layer5" pnt_i pnt_d pnt_e) trig_FBD (shaded_triangle "layer5" pnt_f pnt_b pnt_d) ) (make_jpg) (make_jpg) (alert "Step 2: \nThe areas of these triangles \n are the same") (entdel trig_IDE) (entdel trig_FBD) (setq trig_GAI (shaded_triangle "layer5" pnt_g pnt_a pnt_i) trig_HIA (shaded_triangle "layer5" pnt_h pnt_i pnt_a) ) (make_line_1 "layer8" 0 pnt_i pnt_a) (command "_.delay" 1000) (make_jpg) (make_jpg) (alert "Step 3: \nPentagon FBCKI is \n\nTwo squares (ABFG & AHKC)\n\n+3 Triangles") ;(entdel trig_ABC) (entdel trig_KEC) (setq quad_ABFG (shaded_quad "layer3" pnt_a pnt_b pnt_f pnt_g) quad_AHKC (shaded_quad "layer4" pnt_a pnt_h pnt_k pnt_c) pnt_cr1 '(8.5 8.5) pnt_cr2 '(-3.4 -0.7) ) (make_jpg) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "PENTA_1" pnt_b whole) (command "oops") (my_block_insert "PENTA_1" '(18.0 3.) 1.0) (command "_.zoom" "E") (make_jpg) (alert "Step 4: \nPentagon FBCKI is \n\nOne square ( BCED )\n\n+3 Triangles") (entdel trig_ABC) (entdel trig_GAI) (entdel trig_HIA) (entdel quad_ABFG) (entdel quad_AHKC) (make_jpg) (command "_.delay" 500) (setq quad_BDEC (shaded_quad "layer2" pnt_b pnt_d pnt_e pnt_c) trig_KEC (shaded_triangle "layer5" pnt_k pnt_e pnt_c) trig_IDE (shaded_triangle "layer5" pnt_i pnt_d pnt_e) trig_FBD (shaded_triangle "layer5" pnt_f pnt_b pnt_d) ) (make_jpg) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "PENTA_2" pnt_b whole) (command "oops") (my_block_insert "PENTA_2" '(18.0 -6.) 1.0) (command "_.zoom" "E") (make_jpg) (make_jpg) (make_jpg) (command "_.delay" 500) (entdel quad_BDEC) (entdel trig_KEC) (entdel trig_IDE) (entdel trig_FBD) (make_jpg) (alert "Step 5: \nThree triangles are common for two Penatgons.") (alert "Step 6: Therefore \n\narea of BDEC = sum of the areas of\n\nABFG and AHKC\n\tQ.E.D.") (reset_sysvar) );;;EUCLID_47_6 - - - main ;;; ;;; (defun setup_47_6() (setup_sysvar) (setvar "OSMODE" 0) (command "_.ucsicon" "off") (setq len_a 3. len_b 4. len_c 5. pnt_a '(1.8 2.4) pnt_b '(0 0) pnt_c '(5 0) pnt_f (point_off_line pnt_b pnt_a 0. (dtr 90.) len_a ) pnt_g (pld pnt_c pnt_a (+ len_a len_b)) pnt_h (pld pnt_b pnt_a (+ len_a len_b)) pnt_k (point_off_line pnt_c pnt_a 0. (dtr -90) len_b) pnt_d (pld pnt_f pnt_g len_b) pnt_e (pld pnt_k pnt_h len_a) pnt_i (inters pnt_f pnt_g pnt_k pnt_h nil) ) (command "_.pline" pnt_c pnt_a pnt_h pnt_k "c") (command "_.pline" pnt_a pnt_b pnt_f pnt_g "c") (command "_.pline" pnt_b pnt_c pnt_e pnt_d "c") (command "_.pline" pnt_a pnt_b pnt_c "c") (make_line_1 "layer8" 8 pnt_g pnt_i) (make_line_1 "layer8" 8 pnt_a pnt_i) (make_line_1 "layer8" 8 pnt_h pnt_i) ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 1 chr_size) (make_point "layer8" 0 pnt_b "B" 4 chr_size) (make_point "layer8" 0 pnt_c "C" 4 chr_size) (make_point "layer8" 0 pnt_d "D" 3 chr_size) (make_point "layer8" 0 pnt_e "E" 1 chr_size) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "layer8" 0 pnt_g "G" 3 chr_size) (make_point "layer8" 0 pnt_h "H" 1 chr_size) (make_point "layer8" 0 pnt_i "I" 2 chr_size) (make_point "layer8" 0 pnt_k "K" 1 chr_size) (command "_.point" '(23 10)) (command "_.point" '(23 -8)) (textdisplay "Proof by : Thabit ibn Quarra" '(-2 -3.5) chr_size 0.) ;;;zoom to the extent (command "_.zoom" "E") (setq n_speed 75 n_sec 10) (setq t_pnt '(11.4 2.3) t_height 0.5 t_angle 0.) ;(command "_.rectangle" '(11.25 -3) '(22 3)) );setup_47_6 ;;; copy ;;;*****************EUCLID_47_7******************************************************* ;;; ;;; (defun C:Euclid_47_7() (setup_47_7) (make_jpg) (make_jpg) (make_jpg) (alert "Step 1: Move Triangle FBO to Corner A") (move_ent trig_1 pnt_f pnt_a n_speed ndiv 1 "0") (make_jpg) (make_point "layer8" 0 pnt_i "I" 4 chr_size) (make_jpg) (alert "Step 2: Move Triangle GOB to Corner C") (move_ent trig_2 pnt_g pnt_c n_speed ndiv 1 "0") (make_jpg) (make_point "layer8" 0 pnt_j "J" 1 chr_size) (make_jpg) (alert "Step 3: Move Triangle EOH to Corner B") (move_ent trig_3 pnt_h pnt_j n_speed ndiv 1 "0") (make_jpg) (alert "Final: It is proved \nHGDJ = ABDE + BCFG") (make_jpg) (alert "Copy the result to the right and reverse the process") (setq whole (ssget "C" pnt_cc pnt_aa)) (command "_.copy" whole "" pnt_a pnt_a_new) (command "_.zoom" "E") (make_jpg) (make_jpg) (command "_.delay" 500) (alert "Step 3-: Move Triangle IBJ to EOH ") (move_ent trig_3 pnt_j pnt_h n_speed ndiv 1 "0") (make_jpg) (alert "Step 2-: Move Triangle CHJ to GOB ") (move_ent trig_2 pnt_c pnt_g n_speed ndiv 1 "0") (make_jpg) (alert "Step 1-: Move Triangle AIE to FBO") (move_ent trig_1 pnt_a pnt_f n_speed ndiv 1 "0") (make_jpg) (command "_.delay" 500) (make_jpg) (make_jpg) (make_jpg) (alert "Step 6: Therefore \n\narea of EHJI = sum of the areas of\n\nEOFA and HCGO\n\tQ.E.D.") (reset_sysvar) );;;EUCLID_47_7 ;;; ;;; (defun setup_47_7() (setup_sysvar) ;;fix len_a & len_b for now. (setq len_a 5.0 len_b 3.0 len_ab (+ len_a len_b) len_ab3 (* 3. len_ab) len_ab2 (* 2. len_ab) len_min (* 0.5 (min len_a len_b)) ) (setvar "OSMODE" 0) (command "_.ucsicon" "off") (setq pnt_a '(0 0) pnt_b (list len_ab 0) pnt_c (list len_ab len_ab) pnt_d (list 0 len_ab) pnt_e (list 0 len_a) pnt_f (list len_a 0) pnt_g (list len_ab len_a) pnt_h (list len_a len_ab) pnt_i (list len_b 0) pnt_j (list len_ab len_b) pnt_o (list len_a len_a) pnt_r1 (list len_ab3 len_ab) pnt_r2 (list len_ab3 (- len_min)) pnt_aa (list -0.5 -0.5) pnt_cc (list 8.5 8.5) pnt_a_new (list len_ab2 0) ) (command "_.layer" "set" "layer8" "") (command "_.pline" pnt_a pnt_b pnt_c pnt_d "c") (command "_.layer" "set" "0" "") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5 n_speed 100 ndiv 6 ) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 4 chr_size) (make_point "layer8" 0 pnt_b "B" 4 chr_size) (make_point "layer8" 0 pnt_c "C" 1 chr_size) (make_point "0" 0 pnt_d "D" 3 chr_size) (make_point "layer8" 0 pnt_e "E" 3 chr_size) (make_point "layer8" 0 pnt_f "F" 4 chr_size) (make_point "0" 0 pnt_g "G" 1 chr_size) (make_point "layer8" 0 pnt_h "H" 2 chr_size) (make_point "layer8" 0 pnt_o "O" 1 chr_size) ;;;draw 4 triangles (setq trig_1 (shaded_triangle "layer2" pnt_f pnt_b pnt_o) trig_2 (shaded_triangle "layer3" pnt_g pnt_o pnt_b) trig_3 (shaded_triangle "layer4" pnt_e pnt_o pnt_h) trig_4 (shaded_triangle "layer5" pnt_d pnt_e pnt_h) ) ;;;zoom to the extent (command "_.point" pnt_r1) (command "_.point" pnt_r2) (textdisplay "Proof by : Pythagoras" '(0 -2.5) chr_size 0.) (command "_.zoom" "E") ;(command "_.zoom" "scale" 0.65) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) );setup_47_7 ;;; ;;;*****************EUCLID_47_8******************************************************* ;;; special dissection ;;; command euclid_47_8 ;;; ref-dwg euclid_47_8.dwg ;;; (defun C:Euclid_47_8() (setup_47_8) (make_jpg) (alert " Step 1:\n Rotate Triangle ABC \n around point A") (rotate_ent trig_1 pnt_a pnt_b 90. 25 25 1) (make_jpg) (command "_.delay" 500) (setq whole (ssget "C" pnt_dd pnt_aa)) (my_block_def "step_1" pnt_a whole) (command "oops") (my_block_insert "step_1" '(4.75 2.5) 0.5) (make_jpg) (alert " Step 2:\n Move Triangle IGB \n to point E") (move_ent trig_2 pnt_b pnt_e n_speed 5 1 "0") (make_jpg) (command "_.delay" 500) (setq pnt_k (pld pnt_a pnt_e (+ 2.0 (distance pnt_b pnt_g)))) (setq whole (ssget "C" pnt_dd pnt_aa)) (my_block_def "step_2" pnt_a whole) (make_jpg) (command "_.delay" 500) (command "oops") (my_block_insert "step_2" '(6.75 2.5) 0.5) (make_jpg) (command "_.delay" 500) (alert " Step 3:\n Rotate Triangle LEK \n around point E") (rotate_ent trig_2 pnt_e pnt_k -90. 25 25 1) (make_jpg) (command "_.delay" 500) (setq whole (ssget "C" pnt_dd pnt_aa)) (my_block_def "step_3" pnt_a whole) (command "oops") (my_block_insert "step_3" '(4.75 0.5) 0.5) (make_jpg) (command "_.delay" 500) (alert " Step 4:\n Move Triangle FHD\n aound point D") (rotate_ent trig_3 pnt_d pnt_f -270. 25 25 1) (make_jpg) (command "_.delay" 500) (setq whole (ssget "C" pnt_dd pnt_aa)) (my_block_def "step_4" pnt_a whole) (command "oops") (my_block_insert "step_4" '(6.75 0.5) 0.5) (make_jpg) (command "_.delay" 500) (alert " Step 5:\n Move Square IHDM \n along BF to Point B") (setq ss (ssadd) ss (ssadd trig_3 ss) ss (ssadd quad_4 ss) ) (move_ent ss pnt_i pnt_b n_speed 5 1 "0") (make_jpg) (command "_.delay" 500) (setq whole (ssget "C" pnt_dd pnt_aa)) (my_block_def "step_5" pnt_a whole) (command "oops") (my_block_insert "step_5" '(4.75 -1.5) 0.5) (make_jpg) (command "_.delay" 500) (make_jpg) (command "_.delay" 500) (make_jpg) (command "_.delay" 500) (make_jpg) (command "_.delay" 500) (alert "Reverse the process") (move_ent ss pnt_b pnt_i n_speed 5 1 "0") (make_jpg) (command "_.delay" 500) (alert " Step R-1:\n Move Triangle FHD\n aound point D") (rotate_ent trig_3 pnt_d pnt_g 270. 25 25 1) (make_jpg) (command "_.delay" 500) (make_jpg) (command "_.delay" 500) (alert " Step R-2:\nMove Triangle EFK\n to point G") (rotate_ent trig_2 pnt_e pnt_f 90. 25 25 1) (make_jpg) (command "_.delay" 500) (move_ent trig_2 pnt_e pnt_b n_speed 5 1 "0") (make_jpg) (command "_.delay" 500) (alert " Step R-4:\n Rotate Triangle ABC\n around point A") (rotate_ent trig_1 pnt_a pnt_e -90. 25 25 1) (make_jpg) (make_jpg) (make_jpg) (make_jpg) (reset_sysvar) );;;EUCLID_47_8 ;;; ;;; (defun setup_47_8() (setup_sysvar) (setvar "OSMODE" 512) ;; snap mode "nearest" (command "_.ucsicon" "off") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.25 n_speed 100 ndiv 6 ) (setq pnt_a '(-1 0) pnt_b '(1 0) pnt_o '(0 0) pnt_d '(1 2) pnt_e '(-1 2) low_left '(-2.2 -1.8) up_right '(8.5 4.0) ) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 4 chr_size) (make_point "layer8" 0 pnt_b "B" 4 chr_size) ;(make_point "layer8" 0 pnt_c "C" 1 chr_size) (make_point "layer8" 0 pnt_d "D" 1 chr_size) (make_point "layer8" 0 pnt_e "E" 3 chr_size) (make_line_1 "0" 0 pnt_a pnt_b) (command "_.arc" "CE" pnt_o pnt_b "A" 180.) (command "_.zoom" "E") (command "_.regen") (make_jpg) (command "_.delay" 500) (alert "Select point C\non the semi-circle") (setq pnt_c (getpoint "\nSelect point C on the semi-circle")) (setq len_a (distance pnt_a pnt_c) len_b (distance pnt_b pnt_c) pnt_f (inters pnt_d pnt_e pnt_b pnt_c nil) dist_df (distance pnt_d pnt_f) pnt_g (pld pnt_d pnt_b dist_df) dist_fh (* 0.5 len_b dist_df) pnt_h (pld pnt_f pnt_b dist_fh) pnt_i (pld pnt_h pnt_b len_b) ) (setvar "OSMODE" 0) (setq len_ab (+ len_a len_b) len_ab3 (* 3. len_ab) len_ab2 (* 2. len_ab) len_min (* 0.5 (min len_a len_b)) ) (setq pnt_r1 (list len_ab3 len_ab) pnt_r2 (list len_ab3 (- len_min)) pnt_a_new (list len_ab2 0) del (* 2.5 chr_size) del_dd (list del del) del_aa (list (- del) (- del)) pnt_aa (shift_pnt pnt_a del_aa) pnt_dd (shift_pnt pnt_d del_dd) ) ;;;draw shaded triangles & quadrilaterals (setq trig_1 (shaded_triangle "layer2" pnt_a pnt_b pnt_c) trig_2 (shaded_triangle "layer3" pnt_b pnt_i pnt_g) trig_3 (shaded_triangle "layer4" pnt_d pnt_f pnt_h) quad_4 (shaded_quad "layer5" pnt_g pnt_d pnt_h pnt_i) quad_5 (shaded_quad "layer6" pnt_e pnt_a pnt_c pnt_f) ) ;;;zoom to the extent (command "_.point" pnt_r1) (command "_.point" pnt_r2) (command "_.zoom" "_Win" low_left up_right) ;(command "_.zoom" "scale" 1.55) (make_point "layer8" 1 pnt_c "C" 2 chr_size) (make_point "layer8" 0 pnt_f "F" 1 chr_size) (make_point "layer8" 0 pnt_g "G" 1 chr_size) (make_point "layer8" 0 pnt_h "H" 2 chr_size) (make_point "layer8" 1 pnt_i "I" 1 chr_size) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) );setup_47_8 ;;; ;;;*****************EUCLID_47_9******************************************************* ;;; Yanneys's Proof ;;; command euclid_47_9 ;;; (defun C:Euclid_47_9() (setup_47_9) (make_jpg) (make_jpg) (alert "Step 1: extend CK and find an intersect M on HL") (setq pnt_m (inters pnt_c pnt_k pnt_h pnt_l nil)) (setq pnt_n (inters pnt_f pnt_e pnt_a pnt_l nil)) (make_line_2 "0" 2 "HIDDEN2" pnt_c pnt_m) (make_point "layer8" 0 pnt_m "M" 1 chr_size) (make_point "0" 0 pnt_o "O" 4 chr_size) (make_jpg) (command "_.delay" 500) (alert "Step 2: extend FE and find an intersect N on AL") (setq pnt_n (inters pnt_f pnt_e pnt_a pnt_l nil)) (make_line_2 "0" 2 "HIDDEN2" pnt_f pnt_n) (make_point "layer8" 0 pnt_n "N" 3 chr_size) (make_jpg) (command "_.delay" 500) (alert "Step 3: \nquad ALMO") (setq ALMO (shaded_quad "layer2" pnt_a pnt_l pnt_m pnt_o)) (make_jpg) (command "_.delay" 500) (setq ALMO (entlast)) (setq pnt_cr1 '(9.0 9.0) pnt_cr2 '(-0.5 -0.5)) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACFHL_1" pnt_c whole) (command "oops") (make_jpg) (command "_.delay" 500) (my_block_insert "ACFHL_1" '(10.0 5.) 0.5) (command "_.zoom" "_EXTENT") (entdel ALMO) (make_jpg) (command "_.delay" 500) (alert "Step 4: \nquad ALMO ---> quad ALKC") (command "_.layer" "_set" "layer2" "") (setq len_c (distance pnt_a pnt_l)) (quad_along_line "layer3" pnt_o pnt_c n_sec n_speed pnt_l pnt_a 1 len_c) (make_jpg) (command "_.delay" 500) (command "_.layer" "_set" "0" "") (setq ALKC last_hatch) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACFHL_2" pnt_c whole) (command "_.oops") (my_block_insert "ACFHL_2" '(15.0 5.) 0.5) (command "_.zoom" "_EXTENT") (make_jpg) (command "_.delay" 500) (alert "Step 5:\n quad ALKC ---> quad AEDC") (entdel ALKC) (command "_.layer" "_set" "layer2" "") (setq len_c (distance pnt_a pnt_l)) (quad_along_line "layer3" pnt_k pnt_d n_sec n_speed pnt_a pnt_c 1 len_a) (make_jpg) (command "_.delay" 500) (command "_.layer" "_set" "0" "") (setq AEDC last_hatch) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACFHL_3" pnt_c whole) (command "_.oops") (my_block_insert "ACFHL_3" '(20.0 5.) 0.5) (command "_.zoom" "_EXTENT") (make_jpg) (command "_.delay" 500) (alert "Step 6: \nquad BHMO") (entdel AEDC) (setq BHMO (shaded_quad "layer3" pnt_b pnt_h pnt_m pnt_o)) (make_jpg) (command "_.delay" 500) (setq BHMO (entlast)) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACFHL_4" pnt_c whole) (command "_.oops") (my_block_insert "ACFHL_4" '(10.0 -3.5) 0.5) (command "_.zoom" "_EXTENT") (entdel BHMO) (make_jpg) (command "_.delay" 500) (alert "Step 7: \nquad BHMO ---> quad BHKC") (command "_.layer" "_set" "layer3" "") (quad_along_line "layer3" pnt_o pnt_c n_sec n_speed pnt_h pnt_b 1 len_c) (make_jpg) (command "_.delay" 500) (command "_.layer" "_set" "0" "") (setq BHKC last_hatch) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACFHL_5" pnt_c whole) (command "oops") (my_block_insert "ACFHL_5" '(15.0 -3.5) 0.5) (command "_.zoom" "E") (make_jpg) (command "_.delay" 500) (alert "Step 8:\n quad KHBC ---> quad KHFD") (entdel BHKC) (command "_.layer" "_set" "layer3" "") (quad_along_line "layer3" pnt_b pnt_f n_sec n_speed pnt_k pnt_h 1 len_b) (make_jpg) (command "_.delay" 500) (command "_.layer" "_set" "0" "") (setq KHBC last_hatch) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "ACFHL_6" pnt_c whole) (command "_.oops") (my_block_insert "ACFHL_6" '(20.0 -3.5) 0.5) (command "_.zoom" "_EXTENT") (make_jpg) (make_jpg) (make_jpg) (make_jpg) (command "_.delay" 500) (reset_sysvar) );;;EUCLID_47_9 ;;; ;;; (defun setup_47_9() (setup_sysvar) (setq len_a 3. ;(getreal "\nLength A= ") len_b 5. ;(getreal "\nLength B= ") len_ab (+ len_a len_b) len_ab2 (* 3. len_ab) len_min (* 0.5 (min len_a len_b)) ) (setvar "OSMODE" 0) (command "_.ucsicon" "_off") (setq pnt_a (list 0 len_a) pnt_b (list len_b 0) pnt_c (list 0 0) pnt_d (list len_a 0) pnt_e (list len_a len_a) pnt_f (list len_ab 0) pnt_h (list len_ab len_b) pnt_k (list len_a len_b) pnt_l (list len_a len_ab) pnt_o (inters pnt_a pnt_b pnt_c pnt_k ) pnt_r1 (list len_ab2 (+ len_ab 1.25)) pnt_r2 (list len_ab2 (- (- len_min ) 2.0) ) ) (command "_.layer" "_set" "layer8" "") (command "_.pline" pnt_a pnt_c pnt_d pnt_e "_c") (command "_.pline" pnt_a pnt_b pnt_h pnt_l "_c") (command "_.pline" pnt_l pnt_d pnt_f pnt_h pnt_k "") (command "_.layer" "_set" "0" "") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5 n_speed 100 n_sec 8) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 3 chr_size) (make_point "layer8" 0 pnt_b "B" 4 chr_size) (make_point "layer8" 0 pnt_c "C" 4 chr_size) (make_point "0" 0 pnt_d "D" 4 chr_size) (make_point "layer8" 0 pnt_e "E" 3 chr_size) (make_point "layer8" 0 pnt_f "F" 4 chr_size) (make_point "0" 0 pnt_h "H" 1 chr_size) (make_point "0" 0 pnt_k "K" 3 chr_size) (make_point "0" 0 pnt_l "L" 2 chr_size) ;;;zoom to the extent (command "_.point" pnt_r1) (command "_.point" pnt_r2) (command "_.zoom" "_EXTENT") ;(command "_.zoom" "_scale" 0.65) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) );setup_47_9 ;;; ;;;************************dissection********************************* ;;; (defun C:dissection() (setup_dissection) (loc_xdir) (setq ss_lines (ssadd)) ;;;selection set initialized (array_row_1) (array_all_rows) (square_net) (alert "Move the grid net\n\nclick mouth to select location") (my_block_def "ref_grid" pnt_a ss_lines) (c:move_grid) (reset_sysvar) );dissection ;;; (defun c:move_grid() (setvar "OSMODE" 41) (if (/= grid_block nil) (entdel grid_block)) (command "_.insert" "ref_grid" PAUSE 1. 1. 0.) (setq grid_block (entlast)) );;;move ref_grid block ;;; (defun setup_dissection() (setup_sysvar) (setq len_a 5. ;(getreal "\nLength A= ") len_b 3. ;(getreal "\nLength B= ") len_ab (+ len_a len_b) len_ab2 (* 2. len_ab) len_min (* 0.5 (min len_a len_b)) ) (setvar "OSMODE" 0) (command "_.ucsicon" "off") (setq pnt_a '(0 0 ) pnt_b (list len_a 0) pnt_c (list len_ab 0) pnt_d (list 0 len_a) pnt_e (list len_a len_a) pnt_f (list len_a len_b ) pnt_g (list len_ab len_b) pnt_h (list len_b 0) pnt_i (list (* 0.5 len_a) (* 0.5 len_a)) pnt_j (list (+ len_a (* 0.5 len_b)) (* 0.5 len_b)) len_c (distance pnt_a pnt_f) pnt_k (list len_c 0) ) (command "_.layer" "set" "layer1" "") (command "_.pline" pnt_a pnt_b pnt_e pnt_d "c") (command "_.pline" pnt_b pnt_c pnt_g pnt_f "c") (command "_.layer" "set" "0" "") (setq quad_BCGF (shaded_quad "layer161" pnt_b pnt_c pnt_g pnt_f)) ;;;mark the points (set_txstyle "arial") (setq chr_size 0.5 n_speed 100 n_sec 8 ref_dist (distance pnt_a pnt_f)) ;(regapp "my_point") (make_pt "layer8" 0 pnt_i ) (make_pt "layer8" 0 pnt_j ) ;;;zoom to the extent (command "_.zoom" "E") ;(command "_.zoom" "scale" 0.25) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) );setup_dissection ;;; ;;; (defun loc_xdir() (setq rot_angle (rtd (angle pnt_a pnt_f))) (command "_.rotate" "all" "" pnt_a (- rot_angle)) ;(command "align" "all" "" pnt_a pnt_a pnt_f pnt_k "" "") );loc_xdir ;;; ;;; (defun array_row_1() (command "_array" "all" "" "R" 1 5 ref_dist) );array_row_1 ;;; ;;; (defun array_all_rows() (command "_array" "all" "" "R" 5 1 ref_dist) );array_row_1 ;;; ;;; (defun square_net() (setq minus_ref (- ref_dist) pnt_org (list minus_ref minus_ref) pnt_right (list (* 2. ref_dist) minus_ref) pnt_up (list minus_ref (* 2. ref_dist)) ) (multi_ln_dy pnt_org pnt_right ref_dist 4 2) (multi_ln_dx pnt_org pnt_up ref_dist 4 2) (command "_.zoom" "e") );square_net ;;; ;;; (defun multi_ln_dx(pnt_1 pnt_2 delta_x n_lines ncolor / pnt_from pnt_to x1 x2 y1 y2 nstep ) (setq pnt_from pnt_1 pnt_to pnt_2 x1 (car pnt_1) x2 (car pnt_2) y1 (cadr pnt_1) y2 (cadr pnt_2) nstep 0 ) (repeat n_lines (make_line_1 "0" ncolor pnt_from pnt_to ) (setq ss_lines (ssadd (entlast) ss_lines)) ;;;add entity to the selection set ss (setq nstep (1+ nstep) pnt_from (list (+ x1 (* nstep delta_x)) y1) pnt_to (list (+ x2 (* nstep delta_x)) y2) ) ) );multi_ln_dx ;;; ;;; (defun multi_ln_dy(pnt_1 pnt_2 delta_y n_lines ncolor / pnt_from pnt_to x1 x2 y1 y2 nstep ) (setq pnt_from pnt_1 pnt_to pnt_2 x1 (car pnt_1) x2 (car pnt_2) y1 (cadr pnt_1) y2 (cadr pnt_2) nstep 0 ) (repeat n_lines (make_line_1 "0" ncolor pnt_from pnt_to ) (setq ss_lines (ssadd (entlast) ss_lines)) ;;;add entity to the selection set ss (setq nstep (1+ nstep) pnt_from (list x1 (+ y1 (* nstep delta_y)) ) pnt_to (list x2 (+ y2 (* nstep delta_y)) ) ) ) );multi_ln_dy ;;; ;;; (defun multi_ln_dxdy(pnt_1 pnt_2 delta_x delta_y n_lines ncolor / pnt_from pnt_to x1 x2 y1 y2 nstep ) (setq pnt_from pnt_1 pnt_to pnt_2 x1 (car pnt_1) x2 (car pnt_2) y1 (cadr pnt_1) y2 (cadr pnt_2) nstep 0 ) (repeat n_lines (make_line_1 "0" ncolor pnt_from pnt_to ) (setq ss_lines (ssadd (entlast) ss_lines)) ;;;add entity to the selection set ss (setq nstep (1+ nstep) pnt_from (list (+ x1 (* nstep delta_x)) (+ y1 (* nstep delta_y)) ) pnt_to (list (+ x2 (* nstep delta_x)) (+ y2 (* nstep delta_y)) ) ) ) );multi_ln_dxdy ;;; ;;;******************************************************************************* ;;; Liu Hui's proof by dissection ;;;********************************************************************** (defun C:DISSECT_1() (setup_dissect_1) (make_jpg) (command "_.delay" 500) (alert "Step 1: Shade the squareCBHI \n\n(area=c*c)") (setq quad_LMJK (shaded_quad "layer210" pnt_l pnt_m pnt_j pnt_k) trig_CMN (shaded_triangle "layer50" pnt_c pnt_m pnt_n) trig_HKO (shaded_triangle "layer52" pnt_h pnt_k pnt_o) trig_CJI (shaded_triangle "layer80" pnt_c pnt_j pnt_i) trig_BLH (shaded_triangle "layer81" pnt_b pnt_l pnt_h) trig_BNC (shaded_triangle "layer130" pnt_b pnt_n pnt_c) trig_IOH (shaded_triangle "layer132" pnt_i pnt_o pnt_h) ) (make_jpg) (command "_.delay" 500) (make_jpg) (command "_.delay" 500) (setq pnt_cr1 '(9.0 9.0) pnt_cr2 '(-5.5 -3.8) whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_1" pnt_a whole) (command "oops") (my_block_insert "WHOLE_1" '(17.0 5.0) 0.75) (command "_.zoom" "E") (make_jpg) (command "_.delay" 500) (alert "Step 2:\n Move CMN & HKO to square ABED \n\n(area = b*b)" ) (blink_layer "layer50" 100 2) (command "_.delay" 2000) (setq trig_ABE (shaded_triangle "layer50" pnt_a pnt_b pnt_e)) (blink_layer "layer50" 100 2) (entdel trig_CMN) (command "_.delay" 2000) (make_jpg) (command "_.delay" 500) (blink_layer "layer52" 100 2) (command "_.delay" 2000) (setq trig_EDA (shaded_triangle "layer52" pnt_e pnt_d pnt_a)) (blink_layer "layer52" 100 2) (entdel trig_HKO) (command "_.delay" 2000) (make_jpg) (command "_.delay" 500) (alert "Step 3:\n Move CJI &BLH to square ACFG \n\n(area = a*a)" ) (blink_layer "layer80" 100 2) (command "_.delay" 2000) (setq trig_CFQ (shaded_triangle "layer80" pnt_c pnt_f pnt_q)) (blink_layer "layer80" 100 2) (entdel trig_CJI) (command "_.delay" 2000) (make_jpg) (command "_.delay" 500) (blink_layer "layer81" 100 2) (command "_.delay" 2000) (setq trig_RAC (shaded_triangle "layer81" pnt_r pnt_a pnt_c)) (blink_layer "layer81" 100 2) (entdel trig_BLH) (command "_.delay" 2000) (make_jpg) (command "_.delay" 500) (alert "Step 4:\n Move BNC & IOH to square ACFG \n\n(area = a*a)" ) (blink_layer "layer130" 100 2) (command "_.delay" 2000) (setq trig_QPC (shaded_triangle "layer130" pnt_q pnt_p pnt_c)) (blink_layer "layer130" 100 2) (entdel trig_BNC) (command "_.delay" 2000) (make_jpg) (command "_.delay" 500) (blink_layer "layer140" 100 2) (command "_.delay" 2000) (setq trig_RPC (shaded_triangle "layer140" pnt_r pnt_p pnt_c)) (blink_layer "layer140" 100 2) (entdel trig_IOH) (command "_.delay"2000) (make_jpg) (command "_.delay" 500) (alert "Step 5:\n Move LMJK to square ACFG \n\n(area = a*a)" ) (blink_layer "layer210" 100 2) (command "_.delay" 2000) (setq quad_GQPR (shaded_quad "layer210" pnt_g pnt_q pnt_p pnt_r)) (blink_layer "layer210" 100 2) (entdel quad_LMJK) (command "_.delay" 2000) (make_jpg) (command "_.delay" 500) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_2" pnt_a whole) (command "oops") (my_block_insert "WHOLE_2" '(17.0 -4.5) 0.75) (command "_.zoom" "E") (make_jpg) (command "_.delay" 500) (command "_.delay" 1000) (shaded_quad "layer210" pnt_l pnt_m pnt_j pnt_k) (shaded_triangle "layer50" pnt_c pnt_m pnt_n) (shaded_triangle "layer52" pnt_h pnt_k pnt_o) (shaded_triangle "layer80" pnt_c pnt_j pnt_i) (shaded_triangle "layer81" pnt_b pnt_l pnt_h) (shaded_triangle "layer130" pnt_b pnt_n pnt_c) (shaded_triangle "layer132" pnt_i pnt_o pnt_h) (make_jpg) (make_jpg) (make_jpg) (make_jpg) (alert "It is proved \n\nCBHI = ABED + ACFG\n\n or c*c = a*a + b*b\n\n\tQ.E.D.") (reset_sysvar) );;;DISSECT_1 - - - main ;;; ;;; (defun setup_dissect_1() (setup_sysvar) (setq len_a 5. ;(getreal "\nLength A= ") len_b 3. ;(getreal "\nLength B= ") len_ab (+ len_a len_b) len_ab2 (* 3. len_ab) len_min (* 0.5 (min len_a len_b)) ) (setvar "OSMODE" 0) (command "_.ucsicon" "off") (setq pnt_a '(0 0) pnt_b (list len_b 0) pnt_c (list 0 len_a) pnt_d (list 0 (- len_b)) pnt_e (list len_b (- len_b)) pnt_f (list (- len_a) len_a) pnt_g (list (- len_a) 0) pnt_h (list len_ab len_b) pnt_i (list len_a len_ab) pnt_j (list len_a len_a) pnt_k (list len_a len_b) pnt_l (list len_b len_b) pnt_m (list len_b len_a) pnt_n (list len_b (- len_a len_b)) pnt_o (list len_a (* 2. len_b)) pnt_p (list (- len_b) (- len_a len_b)) pnt_q (list (- len_a) (- len_a len_b)) pnt_r (list (- len_b) 0) pnt_r1 (list len_ab2 (+ len_ab 3.0)) pnt_r2 (list len_ab2 (- (- len_min ) 5.5) ) ) (command "_.layer" "set" "layer8" "") (command "_.pline" pnt_a pnt_e pnt_b pnt_c "c") (command "_.pline" pnt_a pnt_b pnt_e pnt_d "c") (command "_.pline" pnt_a pnt_c pnt_f pnt_g "c") (command "_.pline" pnt_c pnt_b pnt_h pnt_i "c") (command "_.pline" pnt_b pnt_m pnt_c pnt_n "") (command "_.pline" pnt_c pnt_r pnt_p pnt_c pnt_q pnt_p "") (command "_.pline" pnt_l pnt_h pnt_o pnt_i pnt_k pnt_l pnt_m pnt_j "") (command "_.layer" "set" "0" "") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.50) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 1 chr_size) (make_point "layer8" 0 pnt_b "B" 4 chr_size) (make_point "layer8" 0 pnt_c "C" 2 chr_size) (make_point "layer8" 0 pnt_d "D" 4 chr_size) (make_point "layer8" 0 pnt_e "E" 4 chr_size) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "layer8" 0 pnt_g "G" 3 chr_size) (make_point "layer8" 0 pnt_h "H" 4 chr_size) (make_point "layer8" 0 pnt_i "I" 1 chr_size) (make_point "layer8" 0 pnt_j "J" 4 chr_size) (make_point "layer8" 0 pnt_k "K" 4 chr_size) (make_point "layer8" 0 pnt_l "L" 4 chr_size) (make_point "layer8" 0 pnt_m "M" 4 chr_size) (make_point "layer8" 0 pnt_n "N" 4 chr_size) (make_point "layer8" 0 pnt_o "O" 1 chr_size) (make_point "layer8" 0 pnt_p "P" 4 chr_size) (make_point "layer8" 0 pnt_q "Q" 3 chr_size) (make_point "layer8" 0 pnt_r "R" 4 chr_size) ;;;zoom to the extent (command "_.point" pnt_r1) (command "_.point" pnt_r2) (command "_.text" '(-1.5 -5.5) chr_size 0. "Dissection #1") (command "_.text" "" "Proof by : Liu Hui") (command "_.zoom" "E") (setq n_speed 100 n_sec 8) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) );dissect_1 ;;; ;;;******************************************************************************* ;;; J.E.Boettcher's proof by dissection ;;;***************dissect_2******************************************************* (defun C:DISSECT_2() (setup_dissect_2) (make_jpg) (command "_.delay" 500) (alert "Step 1: Shade the squareCBHI \n\n(area=c*c)") (setq trig_CML (shaded_triangle "layer2" pnt_c pnt_m pnt_l) trig_HKJ (shaded_triangle "layer2" pnt_h pnt_k pnt_j) trig_CRM (shaded_triangle "layer3" pnt_c pnt_r pnt_m) trig_HSK (shaded_triangle "layer96" pnt_h pnt_s pnt_k) trig_BMR (shaded_triangle "layer4" pnt_b pnt_m pnt_r) trig_IKS (shaded_triangle "layer4" pnt_i pnt_k pnt_s) trig_BJM (shaded_triangle "layer170" pnt_b pnt_j pnt_m) trig_ILK (shaded_triangle "layer151" pnt_i pnt_l pnt_k) ) (make_jpg) (command "_.delay" 500) (make_jpg) (command "_.delay" 500) (setq pnt_cr1 '(9.0 9.0) pnt_cr2 '(-5.5 -3.8)) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_1" pnt_a whole) (command "oops") (my_block_insert "WHOLE_1" '(17.0 5.0) 0.75) (command "_.zoom" "E") (make_jpg) (command "_.delay" 500) (alert "Step 2:\n Move CML,HKJ,ARM & HSK \nto square ABED \n\n(area = b*b)" ) (move_ent trig_CML pnt_l pnt_o n_speed n_div 0 "0") (make_jpg) (command "_.delay" 2000) (move_ent trig_HKJ pnt_j pnt_n n_speed n_div 0 "0") (make_jpg) ;(blink_layer "layer52" 100 2) (command "_.delay" 2000) (move_ent trig_CRM pnt_c pnt_d n_speed n_div 0 "0") (make_jpg) (command "_.delay" 500) (rotate_ent trig_CRM pnt_d pnt_e 90. 25 25 1) (make_jpg) (command "_.delay" 2000) (move_ent trig_HSK pnt_h pnt_b n_speed n_div 0 "0") (make_jpg) (command "_.delay" 500) (rotate_ent trig_HSK pnt_b pnt_a 90. 25 25 1) (make_jpg) ;(blink_layer "layer52" 100 2) (command "_.delay" 2000) (alert "Step 3:\n Move BMR,IKS ,BJM & ILK to square ACFG \n\n(area = a*a)" ) (move_ent trig_BJM pnt_j pnt_q n_speed n_div 0 "0") (make_jpg) (command "_.delay" 2000) (move_ent trig_ILK pnt_l pnt_p n_speed n_div 0 "0") (make_jpg) (command "_.delay" 2000) (move_ent trig_BMR pnt_m pnt_f n_speed n_div 0 "0") (make_jpg) (command "_.delay" 500) (rotate_ent trig_BMR pnt_f pnt_g 90. 25 25 1) (make_jpg) (command "_.delay" 2000) (move_ent trig_IKS pnt_k pnt_a n_speed n_div 0 "0") (make_jpg) (command "_.delay" 500) (rotate_ent trig_IKS pnt_a pnt_c 90. 25 25 1) (make_jpg) (command "_.delay" 2000) (setq whole (ssget "C" pnt_cr1 pnt_cr2)) (my_block_def "WHOLE_2" pnt_a whole) (command "oops") (my_block_insert "WHOLE_2" '(17.0 -4.5) 0.75) (command "_.zoom" "_EXTENT") (make_jpg) (command "_.delay") (shaded_triangle "layer2" pnt_c pnt_m pnt_l) (shaded_triangle "layer2" pnt_h pnt_k pnt_j) (shaded_triangle "layer3" pnt_c pnt_r pnt_m) (shaded_triangle "layer96" pnt_h pnt_s pnt_k) (shaded_triangle "layer4" pnt_b pnt_m pnt_r) (shaded_triangle "layer4" pnt_i pnt_k pnt_s) (shaded_triangle "layer170" pnt_b pnt_j pnt_m) (shaded_triangle "layer151" pnt_i pnt_l pnt_k) (make_jpg) (make_jpg) (make_jpg) (make_jpg) (alert "It is proved \n\nCBHI = ABED + ACFG\n\n or c*c = a*a + b*b\n\n\tQ.E.D.") (reset_sysvar) );;;DISSECT_2 - - - main ;;; ;;; (defun setup_dissect_2() (setup_sysvar) (setq len_a 5. ;(getreal "\nLength A= ") len_b 3. ;(getreal "\nLength B= ") len_ab (+ len_a len_b) len_ab2 (* 3. len_ab) len_min (* 0.5 (min len_a len_b)) ) (setvar "OSMODE" 0) (command "_.ucsicon" "off") (setq pnt_a '(0 0) pnt_b (list len_b 0) pnt_c (list 0 len_a) pnt_d (list 0 (- len_b)) pnt_e (list len_b (- len_b)) pnt_f (list (- len_a) len_a) pnt_g (list (- len_a) 0) pnt_h (list len_ab len_b) pnt_i (list len_a len_ab) pnt_k (list len_a len_b) pnt_m (list len_b len_a) pnt_j (inters pnt_b pnt_h pnt_m pnt_k nil) pnt_l (inters pnt_c pnt_i pnt_m pnt_k nil) pnt_n (inters pnt_b pnt_h pnt_a pnt_e nil) pnt_o (pld pnt_e pnt_a (distance pnt_a pnt_n)) pnt_p (inters pnt_c pnt_i pnt_a pnt_f nil) pnt_q (pld pnt_a pnt_f (distance pnt_f pnt_p)) pnt_r (pld pnt_c pnt_b (distance pnt_b pnt_n)) pnt_s (pld pnt_h pnt_i (distance pnt_b pnt_n)) pnt_r1 (list len_ab2 (+ len_ab 3.0)) pnt_r2 (list len_ab2 (- (- len_min ) 5.5) ) ) (command "_.layer" "set" "layer8" "") (command "_.pline" pnt_a pnt_b pnt_c "c") (command "_.pline" pnt_a pnt_b pnt_e pnt_d "c") (command "_.pline" pnt_a pnt_c pnt_f pnt_g "c") (command "_.pline" pnt_c pnt_b pnt_h pnt_i "c") (command "_.pline" pnt_a pnt_b pnt_n "c") (command "_.pline" pnt_d pnt_e pnt_o "c") (command "_.pline" pnt_a pnt_d pnt_o "c") (command "_.pline" pnt_e pnt_b pnt_n "c") (command "_.pline" pnt_f pnt_f pnt_p "c") (command "_.pline" pnt_a pnt_g pnt_q "c") (command "_.pline" pnt_a pnt_c pnt_p "c") (command "_.pline" pnt_f pnt_g pnt_q "c") (command "_.pline" pnt_c pnt_m pnt_l "c") (command "_.pline" pnt_h pnt_k pnt_j "c") (command "_.pline" pnt_k pnt_l pnt_i "c") (command "_.pline" pnt_b pnt_m pnt_j "c") (command "_.pline" pnt_c pnt_m pnt_r "c") (command "_.pline" pnt_b pnt_m pnt_r "_c") (command "_.pline" pnt_i pnt_k pnt_s "_c") (command "_.pline" pnt_h pnt_k pnt_s "_c") (command "_.layer" "_set" "0" "") ;;;mark the points (set_txstyle "arial") (setq chr_size 0.50) (regapp "my_point") (make_point "layer8" 0 pnt_a "A" 1 chr_size) (make_point "layer8" 0 pnt_b "B" 4 chr_size) (make_point "layer8" 0 pnt_c "C" 2 chr_size) (make_point "layer8" 0 pnt_d "D" 4 chr_size) (make_point "layer8" 0 pnt_e "E" 4 chr_size) (make_point "layer8" 0 pnt_f "F" 3 chr_size) (make_point "layer8" 0 pnt_g "G" 3 chr_size) (make_point "layer8" 0 pnt_h "H" 4 chr_size) (make_point "layer8" 0 pnt_i "I" 1 chr_size) (make_point "layer8" 0 pnt_j "J" 4 chr_size) (make_point "layer8" 0 pnt_k "K" 4 chr_size) (make_point "layer8" 0 pnt_l "L" 2 chr_size) (make_point "layer8" 0 pnt_m "M" 1 chr_size) (make_point "layer8" 0 pnt_n "N" 4 chr_size) (make_point "layer8" 0 pnt_o "O" 1 chr_size) (make_point "layer8" 0 pnt_p "P" 2 chr_size) (make_point "layer8" 0 pnt_q "Q" 1 chr_size) (make_point "layer8" 0 pnt_r "R" 4 chr_size) (make_point "layer8" 0 pnt_s "S" 1 chr_size) ;;;zoom to the extent (command "_.point" pnt_r1) (command "_.point" pnt_r2) (command "_.text" '(-1.5 -5.5) chr_size 0. "Dissection #2") (command "_.text" "" "Proof by : J.E.Boettcher") (command "_.zoom" "_EXTENT") (setq n_speed 100 n_div 8) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) );dissect_2 ;;; ;;;added the next on May 01,2007 ;;; ;;;Abe_origami_a H.Abe's origami solution ;;; (defun C:Abe_origami_a() (setup_Abe) (make_jpg) (make_jpg) (shade_abe) (make_jpg) (make_jpg) ;move BCH upward (alert " Step 1:\n Move Triangle BCH \n to point A") (move_ent trig_1 pnt_b pnt_a n_speed 10 1 "0") (make_jpg) (make_jpg) ;move CGD & EDGH to the left (alert " Step 2:\n Move CEH & EDGH\n to point B") (setq ss (ssadd) ss (ssadd trig_3 ss) ss (ssadd quad_4 ss) ) (move_ent ss pnt_c pnt_b n_speed 10 1 "0") (make_jpg) (make_jpg) (command "_.zoom" "E") (command "_.regen") ;copy the whole things to the right (alert "\nCopy all to the right.") (command "_.copy" "all" "" pnt_b '(7.5 0)) (command "_.zoom" "E") (command "_.regen") (make_jpg) (make_jpg) ;move BCH downward to the original position (alert " Step 1:\n Move Triangle BCH \n back to the original location") (move_ent trig_1 pnt_a pnt_b n_speed 10 1 "0") (make_jpg) (make_jpg) ;move CGD & EDGH to the left (alert " Step 2:\n Move CEH & EDGH\n back to the original location") (move_ent ss pnt_b pnt_c n_speed 10 1 "0") (make_jpg) (make_jpg) (reset_sysvar) ) ;;; ;;; ;;; ;;;Abe_origami_b H.Abe's origami solution-variation ;;; (defun C:Abe_origami_b() (setup_Abe) (make_jpg) (make_jpg) (command "_.delay" 500) (shade_abe) (make_jpg) (make_jpg) (command "_.delay" 500) ;rotate BCH around B (alert " Step 1:\n Rotate Triangle ABC \n around point A") (rotate_ent trig_1 pnt_b pnt_c 90. 25 25 1) (make_jpg) (make_jpg) (command "_.delay" 500) ;rotate CGD around D (alert " Step 2:\n Rotate CEH & EDGH\n around point D") (setq ss (ssadd) ss (ssadd trig_3 ss) ss (ssadd quad_4 ss) ) (rotate_ent ss pnt_d pnt_c -90. 25 25 1) (make_jpg) (make_jpg) (command "_.delay" 500) (command "_.zoom" "E") (command "_.regen") ;copy the whole things to the right (alert "\nCopy all to the right.") (command "_.copy" "all" "" pnt_b '(7.5 0)) (command "_.zoom" "E") (command "_.regen") (make_jpg) (make_jpg) (command "_.delay" 500) ;rotate BCH to the original position (alert " Step 1:\n Rotate Triangle BCH \n back to the original location") (rotate_ent trig_1 pnt_b pnt_a -90. 25 25 1) (make_jpg) (make_jpg) (command "_.delay" 500) ;rotate CGD & EDGH back to the original locationt (alert " Step 2:\n Rotate CEH & EDGH\n back to the original location") (rotate_ent ss pnt_d pnt_a 90. 25 25 1) (make_jpg) (make_jpg) (command "_.delay" 500) (make_jpg) (make_jpg) (command "_.delay" 500) (reset_sysvar) ) ;;; ;;; (defun setup_Abe() (setup_sysvar) ;;;mark the points (set_txstyle "arial") (setq chr_size 0.25 n_speed 50 ndiv 6 ) (setvar "PDMODE" 32) (setvar "PDSIZE" -2) (setq pnt_a '(0 5) pnt_b '(0 0) pnt_c '(5 0) pnt_d '(5 5) pnt_e '(5 2) pnt_f '(3 5) pnt_i '(0 3) pnt_g (inters pnt_c pnt_f pnt_d pnt_i nil) pnt_h (inters pnt_c pnt_f pnt_b pnt_e nil) low_left '(-1.75 -0.25) up_right '(5.5 7.0) ) (command "_.zoom" "_W" low_left up_right) ;;mark grid ID (mark_id pnt_a "A" 3 chr_size) (mark_id pnt_b "B" 3 chr_size) (mark_id pnt_c "C" 1 chr_size) (mark_id pnt_d "D" 1 chr_size) (command "_.pline" pnt_a pnt_b pnt_c pnt_d "cl") ;;draw a line from B to a point E on CD (alert "\nLine BE") (make_line_1 "0" 1 pnt_b pnt_e) (mark_id pnt_e "E" 1 chr_size) ;;draw a line from C to a point F on AD perpendicular to line BE (alert "\nLine CF perpendicular to BE.") (make_line_1 "0" 1 pnt_c pnt_f) (mark_id pnt_f "F" 2 chr_size) ;;intersecting point is H. (alert "\nH is the point of intersection.") (mark_id pnt_h "H" 3 chr_size) ;;draw a line DG D normal to line CF. (alert "\nLine DG normal to CF") (make_line_1 "0" 0 pnt_d pnt_g) (mark_id pnt_g "G" 3 chr_size) ;(command "_.zoom" "E") (command "_.regen") );setup_Abe ;;; ;;; ;;; (defun shade_abe() ;;;draw shaded triangles & quadrilaterals (setq trig_1 (shaded_triangle "layer2" pnt_b pnt_c pnt_h) trig_2 (shaded_triangle "layer3" pnt_d pnt_f pnt_g) trig_3 (shaded_triangle "layer4" pnt_c pnt_e pnt_h) quad_4 (shaded_quad "layer5" pnt_e pnt_d pnt_g pnt_h) ;;quad_5 (shaded_quad "layer9" pnt_a pnt_b pnt_h pnt_f) ) ;;;shade polygon DHGFE by 45 deg by 0.2 inch cross hatch (command "_.pline" pnt_a pnt_b pnt_h pnt_f "_cl") (setq pl_ABHF (entlast)) (command "_.hatch" "_U" 45. 0.2 "_N" pl_ABHF "") );; ;;; ;;;CIRCLE_TEXT text in a circle ;;; (defun circle_text(text text_size circle_center / circle_radius qtr_text half_text text_pnt) (setq qtr_text (* 0.25 text_size) half_text (* 0.5 text_size) circle_radius (* 0.75 text_size) text_pnt (shift_pnt circle_center (list (- qtr_text) (- half_text) )) ) (make_circle_1 "0" 0 circle_center circle_radius) (textdisplay text text_pnt text_size 0.) );; ;;; ;;; (defun c:Abe_origami() (setup_Abe) (circle_text "1" 0.25 '(2.4 1.25)) (circle_text "2" 0.25 '(3.5 2.9)) (circle_text "3" 0.25 '(4.1 4.3)) ) ;;; (princ)