; 3D coordinate plotting ; By Andy Yeh cs reset ; define a procedure to draw the three axes to axes :length line meter setpcname "red home west :length pd east :length * 2 pu setpcname "blue home north :length pd south :length * 2 pu setpcname "green home up :length pd down :length * 2 pu end ; define the mathematical function to be plotted to fn :x :y output :x*:y^3 - :y*:x^3 end ; start creating objects axes 10 setpcname "black home point pd repeat 20 [ make "x repcount-10 repeat 20 [ make "y repcount-10 make "z fn :x :y setxyz :x :y :z/1000 ] ] pu showall