Back
to-degrees (clj)
(source)function
(to-degrees r)
Converts an angle in radians to an approximate equivalent angle in degrees.
See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#toDegrees-double-
Examples
clojure
(ns clojure.test-clojure.math
(:require
[clojure.test :refer :all]
[clojure.math :as m]))
(deftest test-radians-degrees-roundtrip
(doseq [d (range 0.0 360.0 5.0)]
(is (ulp= (m/round d) (m/round (-> d m/to-radians m/to-degrees)) 1))))