Gradian support

Create issue
Issue #808 resolved
Mikko Syrjä created an issue

Any interest for gradian/gon support? I work for land surveying industry in northern Europe and gons are widely used here.

Made a fork for testing: https://bitbucket.org/syrja/speedcrunch/branch/gradian

What works:

  • All trigonometric calculations.
  • UI unit selection in menu and status bar.
  • Unit conversions with names gradian and gon (200 gon in radian = 3.14159...)
  • New function gradians() converts from radians to gradians.

Does not work:

  • No shortcut key (F9 radian, F10 degree, F11 already reserved).
  • No function from gradians to radians (needs good name).

Shortcut key problem could be solved by using single key for cycling through deg->rad->grad like in traditional calculators (and status bar).

Comments (5)

  1. Helder Correia repo owner

    Hi, Mikko. Thank you very much for your contribution. I am not an expert in that field, so I'll just leave the comment that I'm missing tests for this.

  2. Pol Welter

    I do like the idea of cycling the mode.

    Why would we need this many conversion functions? Conversion functions should just assume that the argument is expressed in the currently native units.

    E.g. when in Radian mode, degrees(x) converts radians to degrees. When in Gradian mode, it converts gradians to degrees, etc. The unit of the argument can optionally be specified by explicitly giving the unit, e.g. radians(20 degree) = 0.34906585039886591538 radian should work regardless of the current angle mode.

    Note that this is not how it currently works, but how I'd like it to behave :) Right now the conversion functions just feel a bit awkward compared to unit casts.

    I agree that it might be outside of the scope of Mikko's work.

  3. Log in to comment