Source

caml2geom / test1.ml

Full commit
open Caml2geom

let p = Point.copy (Point.make_at_origin ()) ;;
Point.set_coord p 1 50. ;;
Printf.printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);;
Point.set_coord p 0 10. ;;
Printf.printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);;
Point.normalize p ;;
Printf.printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);;
let p = Point.ccw p ;;
Printf.printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);;
let p = Point.cw p ;;
Printf.printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);;