in reply to Re^4: RFC: Math::Triangle (Perl 6)
in thread RFC: Math::Triangle (Perl 6)

Angles have multiple representations for example. In Radians and Degrees.

The same reasoning holds for any magnitude (as for instance those representing length, time, weight, etc.), and well, you could define an algebra where magnitudes carry their units and make a lot of interesting things with it, like checking that your operations are consistent and that you don't add meters to seconds, for instance.

But just doing it for angles, well...

and who knows what else.

Yes, exactly, what else?

The only interesting thing I can think of is to avoid rounding errors. For instance, computers can not represent 90degrees in radians, just an approximation. Math::Angle could overload trigonometric operations and compute then using the degrees representation, without converting to radians first... but well, that's a daunting (and slow) task!

Update: s/degradians/degrees/

Replies are listed 'Best First'.
Re^6: RFC: Math::Triangle (Perl 6)
by holli (Abbot) on Sep 18, 2017 at 15:20 UTC
    Isn't there a degree scale that uses 400° instead of 360°?


    holli

    You can lead your users to water, but alas, you cannot drown them.
      gradians
Re^6: RFC: Math::Triangle (Perl 6)
by soonix (Chancellor) on Sep 18, 2017 at 16:58 UTC
    where magnitudes carry their units and make a lot of interesting things with it, like checking that your operations are consistent and that you don't add meters to seconds, for instance.
    That's what I did in school in Physics, to help being sure I did use the right formula. The probability of getting the correct units with a wrong formula is very low, at least at school :-)