Skip to content

Instantly share code, notes, and snippets.

@dodo
dodo / rtrt.js
Created August 30, 2011 17:59 — forked from jwagner/rtrt.js
var abs = Math.abs;
var sqrt = Math.sqrt;
var floor = Math.floor;
var min = Math.min;
var V3 = function(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
}
import System.Random
import Control.Monad.State
type Point = (Double, Double)
pointPlus :: Point -> Point -> Point
pointPlus (x1, y1) (x2, y2) = (x1 + x2, y1 + y2)
polarToPoint :: Double -> Double -> Point
polarToPoint angle length