Closed nbriz closed 7 years ago
Ah, probably related to this. I implemented those functions very quickly and never went back to test very thoroughly. Hm... I don't remember us yet choosing a style for liBB that prefers degrees over radians (or vice versa) as parameters for functions. Do you have a preference? I'd say update it to use whatever you feel makes the most sense and then I can go back and update all uses of the function in the library/examples to match the preferred style. As for preferring radians to degrees I don't care much either way as long as we stay consistent.
i don't have a preference, but seeing as how the native API's default to radians, maybe we make that our default too?
i rewrote these two functions ( for what is now called BB.Maths ) like so:
static cartesianToPolar(x, y)
// returns { distance, radians, degrees }
static polarToCartesian(distance, angle) // angle in radians
// returns { x, y }
@brannondorsey was using polarToCartesian( radius, degrees ) && getting some funky results, but then when i passed it ( radius, radians ) it worked as expected. should we change the function so that it actually takes degrees? or should we just change the documentation to radians... or am i missing something else entirely?