Run
Share
Reset
Back to mewo2.com
; Welcome to Haversine! ; ; Haversine is a dialect of Logo based around spherical geometry. You ; can use the following commands (all units are in degrees): ; ; fd bk lt rt ; penup pendown clear ; sin cos tan asin acos atan ; ; For variables, control flow, you can use, e.g. ; ; if :x > 0 [fd 100] [fd 50] ; repeat 3 [fd 90 rt 90] ; to square :x ; output :x ^ 2 ; end ; let :y (square :x) ; ; ; Some useful extra builtins, because spheres are hard: ; ; (dihedral :p :q) returns the dihedral angle for a polyhedron ; that has p faces meeting at a vertex, each with q sides ; ; (polyangle :n :side) returns the turn angle for a regular ; n-gon with sides of length side to dodec let :d (dihedral 5 3) repeat 5 [ repeat 5 [fd :d lt 60 fd :d rt 60] fd :d rt 60] end clear dodec
Sharing URL:
Done