Closed iamdustan closed 11 years ago
Great, thanks! Could you add some tests and an entry to the changelog please?
Thanks for making me add the tests @basecode.
I had written them in backwards (the method names are in reverse order as to what I am used to).
I like the xToY
approach. The x is for verbosity and the y is what I want, being the last thing read it keeps it closer to mind.
To implode this pull request: in addition to the discussion about wording we had talked about css multiple units deg
rad
turn
and grad
(https://developer.mozilla.org/en-US/docs/CSS/angle). Would this pull request be usurped by that? The only real usefulness in radToDeg
is to log out numbers in mere-mortal form.'
/**
* @param {String} angle the angle in grad, deg, turn or rad
* @param {String} returnUnit the unit to return
*/
function parseAngle(angle, returnUnit) {}
Hmm... the motivation behind returnUnit is simply to get the angle in degrees back, but I don’t want that to be the motivating factor behind the increased complexity of that method so I’m open to ditching it.
Shall we remove the returnUnit and precision-parameter and just return the computed value? I think that would make everything more clear. When it's done we can tackle the unit issue.
What do you think about keeping these? I’m cool with ditching and closing this in favor of #167
Closed in favor of #167
As per discussion at: https://github.com/uxebu/bonsai/pull/142#issuecomment-9942288