mirror of
https://github.com/richardharrington/robotwar.git
synced 2024-05-28 23:41:31 +00:00
changed t physics module to use Java Math/toRadians function
This commit is contained in:
parent
cc1dee5418
commit
8012bbb138
|
@ -2,17 +2,13 @@
|
|||
|
||||
; trig functions
|
||||
|
||||
(defn deg->rad
|
||||
[angle]
|
||||
(* angle (/ Math/PI 180)))
|
||||
|
||||
(defn robotwar-deg->clojure-deg
|
||||
[angle]
|
||||
(- angle 90))
|
||||
|
||||
(defn decompose-angle
|
||||
[angle-in-degrees]
|
||||
(let [angle (deg->rad (robotwar-deg->clojure-deg angle-in-degrees))]
|
||||
(let [angle (Math/toRadians (robotwar-deg->clojure-deg angle-in-degrees))]
|
||||
{:x (Math/cos angle)
|
||||
:y (Math/sin angle)}))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user