mirror of
https://github.com/penpot/penpot.git
synced 2025-07-01 20:57:16 +02:00
Move matrix math and svg under uxbox.util ns.
This commit is contained in:
parent
ce5675639f
commit
db73b0787b
4 changed files with 6 additions and 6 deletions
33
src/uxbox/util/math.cljs
Normal file
33
src/uxbox/util/math.cljs
Normal file
|
@ -0,0 +1,33 @@
|
|||
(ns uxbox.util.math
|
||||
"A collection of math utils."
|
||||
(:require [goog.math :as math]))
|
||||
|
||||
(defn sin
|
||||
"Returns the sine of a number"
|
||||
[^number v]
|
||||
(js/Math.sin v))
|
||||
|
||||
(defn cos
|
||||
"Returns the cosine of a number."
|
||||
[^number v]
|
||||
(js/Math.cos v))
|
||||
|
||||
(defn tan
|
||||
"Returns the tangent of a number."
|
||||
[^number v]
|
||||
(js/Math.tan v))
|
||||
|
||||
(defn neg
|
||||
"Negate the number"
|
||||
[^number v]
|
||||
(- v))
|
||||
|
||||
(defn radiants
|
||||
"Converts degrees to radians."
|
||||
[^number degrees]
|
||||
(math/toRadians degrees))
|
||||
|
||||
(defn degrees
|
||||
"Converts radians to degrees."
|
||||
[^number radiants]
|
||||
(math/toDegrees radiants))
|
Loading…
Add table
Add a link
Reference in a new issue