X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?p=clnl;a=blobdiff_plain;f=src%2Fmain%2Fnvm.lisp;h=018ce7e650341d7d1327163b8c0be343e4c1b8fa;hp=37df1cb5de69985fea895d25ee1d4486e70ed372;hb=34a7f8e;hpb=213ed30b45140af3f34b7e003aa60394178d524c diff --git a/src/main/nvm.lisp b/src/main/nvm.lisp index 37df1cb..018ce7e 100644 --- a/src/main/nvm.lisp +++ b/src/main/nvm.lisp @@ -141,8 +141,12 @@ DESCRIPTION: See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#forward" (when (not (turtle-p *self*)) (error "Gotta call fd in turtle scope, dude (~A)" *self*)) - (setf (turtle-xcor *self*) (+ (turtle-xcor *self*) (* n (sin (* pi (/ (turtle-heading *self*) 180)))))) - (setf (turtle-ycor *self*) (+ (turtle-ycor *self*) (* n (cos (* pi (/ (turtle-heading *self*) 180))))))) + (setf + (turtle-xcor *self*) + (+ (turtle-xcor *self*) (* n (strictmath:sin (strictmath:to-radians (turtle-heading *self*)))))) + (setf + (turtle-ycor *self*) + (+ (turtle-ycor *self*) (* n (strictmath:cos (strictmath:to-radians (turtle-heading *self*))))))) (defun create-turtles (n) "CREATE-TURTLES N => RESULT