uxebu / bonsai

BonsaiJS is a graphics library and renderer
http://bonsaijs.org
Other
1.96k stars 189 forks source link

Rad/degree conversion helpers #165

Closed iamdustan closed 11 years ago

iamdustan commented 11 years ago

As per discussion at: https://github.com/uxebu/bonsai/pull/142#issuecomment-9942288

basecode commented 11 years ago

Great, thanks! Could you add some tests and an entry to the changelog please?

iamdustan commented 11 years ago

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).

iamdustan commented 11 years ago

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) {}
iamdustan commented 11 years ago

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.

basecode commented 11 years ago

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.

iamdustan commented 11 years ago

What do you think about keeping these? I’m cool with ditching and closing this in favor of #167

basecode commented 11 years ago

Closed in favor of #167