computational geometry code bricks for JavaScript