mirror of
https://github.com/carp-lang/Carp.git
synced 2024-10-11 12:37:32 +03:00
16 lines
478 B
Plaintext
16 lines
478 B
Plaintext
(load "Vector.carp")
|
|
(load "Geometry.carp")
|
|
|
|
(use-all IO Vector2 Geometry)
|
|
|
|
(defn main []
|
|
(let [x (Vector2.init 1.0 2.0)
|
|
y (Vector2.init 3.0 4.0)]
|
|
(do
|
|
(println &(str &(Vector2.add &x &y)))
|
|
(println &(str &x))
|
|
(println &(str &y))
|
|
(println &(Double.str (Vector2.mag &y)))
|
|
(println &(str &(Vector2.rotate &x (Geometry.degree-to-radians 90.0))))
|
|
(println &(Double.str (Geometry.radians-to-degree (Vector2.angle-between &x &y)))))))
|