2019-03-22 22:33:06 +03:00
|
|
|
(load "core/Vector.carp") ;; specified path to avoid loading itself on case insensitive file systems
|
|
|
|
(load "core/Geometry.carp")
|
2017-11-22 18:25:05 +03:00
|
|
|
|
2017-12-12 17:08:33 +03:00
|
|
|
(use-all IO Vector2 Geometry)
|
2017-10-19 18:31:55 +03:00
|
|
|
|
|
|
|
(defn main []
|
2017-10-20 01:27:35 +03:00
|
|
|
(let [x (Vector2.init 1.0 2.0)
|
|
|
|
y (Vector2.init 3.0 4.0)]
|
2017-10-19 18:31:55 +03:00
|
|
|
(do
|
2017-12-13 13:12:34 +03:00
|
|
|
(println &(str &(Vector2.add &x &y)))
|
|
|
|
(println &(str &x))
|
|
|
|
(println &(str &y))
|
2017-10-20 01:27:35 +03:00
|
|
|
(println &(Double.str (Vector2.mag &y)))
|
2017-12-13 13:12:34 +03:00
|
|
|
(println &(str &(Vector2.rotate &x (Geometry.degree-to-radians 90.0))))
|
2017-10-20 01:44:25 +03:00
|
|
|
(println &(Double.str (Geometry.radians-to-degree (Vector2.angle-between &x &y)))))))
|