hoaproject/Math

Why change the initial behavior for trigonometry operator ?

tyx opened this issue · 9 comments

tyx commented

Hi !

We have an issue with Math lib as PHP (and other main languages) use sin, cos, ... with radian value as parameter. But Hoa\Math change that for degree value.

What about going back on this behavior ? And thanks to deg2rad we will be able to perform the same kind of operation.

I'm ready to do the PR if it seems ok for everyone.

tyx commented

See #7

👍

I thought in mathematic, cos, sin etc... uses deg but it's wrong.

Fucking school !

@Hywan:

java, objective C, javascript, ... trigonometric functions have radians arguments.

From Wikipedia:

L'unité internationale de mesure des angles est cependant le radian, défini comme le rapport entre la longueur de l'arc intercepté et le rayon du cercle. Le tour complet correspond donc à 2\pi radians.

So, given we bring some deg2rad & rad2deg methods we can embrace the standard even if we are a bit BC break here.

@shouze: We already convert degree to radian, so we use the standard unit. However, it does not let the user the ability to convert it by herself. Considering we rely on the standard, we must not convert degree into radian because we require radians as inputs. So 👍 to merge this PR.

Are you all agree?

👍

tyx commented

👍

tyx commented

PR updated with shortest syntax