;;;Approximate Construction of pi ;;; ;;;Pi_construction.lsp ;;; ;;; Takaya Iwamoto Feb 9, 2007 ;;; ;;; Kochansky(1685) ;;; Gelder(1849) ;;; Hobson(1913) ;;;Ref. Petr Beckmann "a History of Pi" ;;; ;;;Kochansky (defun C:Kochansky() (setup_sysvar) (setvar "PDMODE" 32) (setvar "PDSIZE" -3) (setq sqrt_3 (sqrt 3.) pnt_org '(0 0) pnt_a '(0 -1) pnt_b '(0 1) pnt_d '(3. -1) pnt_c (list (/ sqrt_3 3.) 1.) ) ;;make_pt (make_pt "0" 1 pnt_org) (make_pt "0" 0 pnt_a) (make_pt "0" 0 pnt_b) (make_pt "0" 0 pnt_c) (make_pt "0" 0 pnt_d) ;;mark_id (mark_id pnt_org "O" 3 0.15) (mark_id pnt_a "A" 3 0.15) (mark_id pnt_b "B" 3 0.15) (mark_id pnt_c "C" 2 0.15) (mark_id pnt_d "D" 4 0.15) (command "_.dimaligned" pnt_a pnt_d "_T" "" '(1.5 -1.2)) (command "_.dimlinear" pnt_a pnt_b '(0.8 0)) (mark_angle pnt_b pnt_org pnt_c 0.5 "p/6" 0.10 2) ;;make_line_1 (make_line_1 "0" 8 pnt_a pnt_b) (make_line_1 "0" 8 pnt_b pnt_c) (make_line_1 "0" 8 pnt_a pnt_d) (make_line_1 "0" 8 pnt_org pnt_c) (command "_.arc" "_C" pnt_org pnt_a pnt_b) (setq half_circle (entlast)) ;(command "_.dimradius" half_circle "" '(2.3 0)) (make_line_1 "0" 2 pnt_c pnt_d) (command "_.dimaligned" pnt_c pnt_d "_T" "" '(2.3 0)) (command "_.zoom" "_E") (command "_.regen") (reset_sysvar) ) ;;; ;;;Gelder (defun C:Gelder() (setup_sysvar) (setvar "PDMODE" 32) (setvar "PDSIZE" -3) (setq pnt_a '(-1 0) pnt_b '(1 0) pnt_c '(0 0) pnt_d '(0 1) pnt_e '(0 0.875) pnt_f (pld pnt_a pnt_e 0.5) pnt_g (list (car pnt_f) 0.) ratio (/ 0.5 (distance pnt_a pnt_e)) pnt_h (plt pnt_a pnt_g ratio) ) ;;make_pt (make_pt "0" 1 pnt_c) (make_pt "0" 0 pnt_a) (make_pt "0" 0 pnt_b) (make_pt "0" 0 pnt_d) (make_pt "0" 0 pnt_e) ;;mark_id (mark_id pnt_c "C" 4 0.10) (mark_id pnt_a "A" 3 0.10) (mark_id pnt_b "B" 1 0.10) (mark_id pnt_d "D" 2 0.10) (mark_id pnt_e "E" 4 0.10) ;;make_line_1 (make_line_1 "0" 8 pnt_a pnt_b) (make_line_1 "0" 8 pnt_c pnt_d) ;;semi_circle (command "_.arc" "_C" pnt_c pnt_b pnt_a) ;;pnt_F (make_line_1 "0" 8 pnt_a pnt_e) (make_pt "0" 0 pnt_f) (mark_id pnt_f "F" 2 0.10) ;;pnt_G (make_pt "0" 0 pnt_g) (mark_id pnt_g "G" 4 0.10) (make_line_1 "0" 8 pnt_f pnt_g) ;;line GE (make_line_1 "0" 8 pnt_g pnt_e) ;;pnt_H (make_line_1 "0" 8 pnt_f pnt_h) (make_pt "0" 0 pnt_h) (mark_id pnt_h "H" 4 0.10) ;;line_AH (make_line_1 "0" 2 pnt_a pnt_h) ;; (command "_.dimlinear" pnt_a pnt_h '(-0.5 -0.5)) (command "_.zoom" "_E") (command "_.regen") (reset_sysvar) );; ;;; ;;;Hobson (defun C:Hobson() (setup_sysvar) (setvar "PDMODE" 32) (setvar "PDSIZE" -3) (setq pnt_org '(0 0) pnt_a '(-1 0) pnt_b '(1 0) pnt_d '(-0.6 0) pnt_e '(0.5 0) pnt_f '(1.5 0) pnt_g (list 0. (sqrt 0.3)) pnt_h (list 0. (- (sqrt 1.5)) ) root_pi (distance pnt_g pnt_h) pnt_i (list root_pi (- (sqrt 1.5))) pnt_j (list root_pi (sqrt 0.3)) y_up '(0 1) y_down '(0 -1.5) rad_1 (* 0.5 (distance pnt_d pnt_e)) rad_2 (* 0.5 (distance pnt_a pnt_f)) pnt_c1 '(-0.05 0) pnt_c2 '(0.25 0) ) ;;make_pt (make_pt "0" 1 pnt_org) (make_pt "0" 0 pnt_a) (make_pt "0" 0 pnt_b) (make_pt "0" 0 pnt_d) (make_pt "0" 0 pnt_e) (make_pt "0" 0 pnt_f) ;;mark_id (mark_id pnt_org "O" 4 0.1) (mark_id pnt_b "B" 4 0.1) (mark_id pnt_a "A" 3 0.1) (mark_id pnt_e "E" 4 0.1) (mark_id pnt_d "D" 4 0.1) (mark_id pnt_f "F" 1 0.1) (make_line_1 "0" 8 pnt_a pnt_f) (make_line_1 "0" 8 y_up y_down) (command "_.arc" "_C" pnt_c1 pnt_e pnt_d) ;(setq in_circle (entlast)) (command "_.arc" "_C" pnt_c2 pnt_a pnt_f) ;(setq out_circle (entlast)) ;;;trim operation (make_pt "0" 0 pnt_g) (make_pt "0" 0 pnt_h) (make_pt "0" 0 pnt_i) (make_pt "0" 0 pnt_j) (mark_id pnt_g "G" 1 0.1) (mark_id pnt_h "H" 4 0.1) (mark_id pnt_i "I" 4 0.1) (mark_id pnt_j "J" 2 0.1) ;(command "_.trim" in_circle "" y_up "") ;(command "_.trim" out_circle "" y_down "") (make_circle_1 "0" 2 pnt_org 1.0) ;;;polygon (command "_.polygon" 4 "_E" pnt_g pnt_h) (command "_.zoom" "_E") (command "_.regen") (reset_sysvar) ) ;;;