2 Ревизии b438911568 ... 66d920b8de

Автор SHA1 Съобщение Дата
  Jason K. MacDuffie 66d920b8de implement circle преди 6 месеца
  Jason K. MacDuffie 40db935231 fix bug in face! преди 6 месеца
променени са 2 файла, в които са добавени 9 реда и са изтрити 4 реда
  1. 8 3
      simple.sld
  2. 1 1
      turtle3.body.scm

+ 8 - 3
simple.sld

@@ -3,6 +3,7 @@
   (import (turtle turtle3)
           (turtle vector)
           (scheme case-lambda)
+          (only (scheme inexact) acos)
           (scheme base))
   (export forward back right left up down
           fd bk rt lt pu pd
@@ -11,7 +12,7 @@
           show hide draw-line home reset-tilt
           repeat xcor ycor setx sety
           clear-screen max-recur face
-          distance angle)
+          distance angle circle)
   (begin
     (define current-tilt 0)
     (define (tilt)
@@ -85,5 +86,9 @@
     (define (angle A B C)
       (radians->degrees
        (vector-angle (vector-difference B A)
-                     (vector-difference B C))))))
-    
+                     (vector-difference B C))))
+    (define (circle r)
+      (define pi (* 2 (acos 0)))
+      (repeat (40)
+        (fd (* 2 pi r 1/40))
+        (rt 9)))))

+ 1 - 1
turtle3.body.scm

@@ -219,7 +219,7 @@
   (define U (list-ref old-orient 2))
   (define new-L (vector-cross-product U new-H))
 
-  (define new-orient (list new-H U new-L))
+  (define new-orient (list new-H new-L U))
 
   (apply set-orient! t new-orient))