# caml2geom / test1.ml

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42``` ```open Caml2geom open Printf (*-----------------------------------------------------------------------*) let _ = printf "Coord.epsilon = %f\n" (Coord.epsilon) ;; let _ = printf "Coord.infinity () = %f\n" (Coord.infinity ()) ;; let _ = printf "Coord.are_near 4.00 4.09 = %B\n" (Coord.are_near 4.00 4.09) ;; let _ = printf "Coord.are_near_eps 0.1 4.00 4.09 = %B\n" (Coord.are_near_eps 0.1 4.00 4.09);; let _ = printf "Coord.rel_error_bound 4.00 4.09 = %B\n" (Coord.rel_error_bound 4.00 4.09) ;; let _ = printf "Coord.rel_error_bound_eps 0.1 4.00 4.09 = %B\n" (Coord.rel_error_bound_eps 0.1 4.00 4.09);; (*-----------------------------------------------------------------------*) let p = Point.copy (Point.make_at_origin ()) ;; Point.set_coord p 1 50. ;; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; Point.set_coord p 0 10. ;; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; Point.normalize p ;; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; let p = Point.ccw p ;; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; let p = Point.cw p ;; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; let p = Point.neg p ;; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; Point.add_to p (Point.make 100. 100.);; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; Point.sub_from p (Point.make 100. 100.);; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; Point.mul_by p 1000.;; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; Point.div_by p 1000.;; let _ = printf "(%f,%f) %f\n" (Point.coord p 0) (Point.coord (Point.copy p) 1) (Point.length p);; let q = Point.make_at_origin ();; let _ = printf "(%f,%f) %f\n" (Point.coord q 0) (Point.coord q 1) (Point.length q);; Point.set q (Point.make (-50.) 50.);; let _ = printf "(%f,%f) %f\n" (Point.coord q 0) (Point.coord q 1) (Point.length q);; (*-----------------------------------------------------------------------*) ```