})
-let obj = { rotate: 90, shear:2, origin: [600, 600], translate: [100, 100] }
+let obj = { rotate: 100, shear:2, origin: [600, 600], translate: [100, 100] }
a.clone() // startPosition
a.clone().transform(obj) // endPosition
-a.animate(new SVG.PID(0.1, 0.1)).transform(obj) // animation
+a.animate(new SVG.Spring(50, 30)).transform(obj) // animation
// Put an ellipse where we expect the object to be
var lam = (a * c + b * d) / determinant
var sy = ((c * sx) / (lam * a - b)) || ((d * sx) / (lam * b + a))
+ // Use the translations
let tx = e - cx + cx * ct * sx + cy * (lam * ct * sx - st * sy)
let ty = f - cy + cx * st * sx + cy * (lam * st * sx + ct * sy)
}
// FIXME: correct the rotation so that it takes the shortest path
+ // GIVE ME (rCurrent) (rTarget) - to store the current/target angle
+ const possibilities = [rTarget - 360, rTarget, rTarget + 360]
+ const distances = possibilities.map( a => Math.abs(a - rCurrent) )
+ const shortest = Math.min(...distances)
+ const index = distances.indexOf(shortest)
+ const target = possibilities[index]
+
morpher.from(startMatrix)
}, function (pos) {