summaryrefslogtreecommitdiffstats
path: root/src/helpers.js
diff options
context:
space:
mode:
authorSaivan <savian@me.com>2018-03-03 22:08:26 +1100
committerSaivan <savian@me.com>2018-03-03 22:08:26 +1100
commite065a4415b7d6991ac14de81646f109e43bef9e7 (patch)
tree03a40cfdd89b8109bcffd871f523a2e516918a4d /src/helpers.js
parent8991bd195817c38e76bdf15accf16cf321ba84cf (diff)
downloadsvg.js-e065a4415b7d6991ac14de81646f109e43bef9e7.tar.gz
svg.js-e065a4415b7d6991ac14de81646f109e43bef9e7.zip
Added matrix composition and decompositions
This commit adds matrix composition and decompositions (untested), it also adds another playground to test that this is working as expected in every case. We also fixed a few linting errors.
Diffstat (limited to 'src/helpers.js')
-rw-r--r--src/helpers.js17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/helpers.js b/src/helpers.js
index 16e6e4e..5a15bf9 100644
--- a/src/helpers.js
+++ b/src/helpers.js
@@ -209,21 +209,6 @@ function idFromReference (url) {
// Create matrix array for looping
var abcdef = 'abcdef'.split('')
-// Gets the distance of a point (a, b) from the origin
-function mag (a, b) {
- return Math.sqrt(a * a + b * b)
-}
-
-// Given a coordinate (a, b), this will calculate the sin, cosine and angle
-// of this point projected onto the unit circle directly
-function unitCircle (a, b) {
- var thetaRad = Math.atan2(b, a)
- var thetaDeg = thetaRad * 180 / Math.PI
- var cos = Math.cos(thetaRad)
- var sin = Math.sin(thetaRad)
- return {theta: thetaDeg, cos: cos, sin: sin}
-}
-
function closeEnough (a, b, threshold) {
- return Math.abs (b - a) < (threshold || 1e-6)
+ return Math.abs(b - a) < (threshold || 1e-6)
}