ideas about representing degrees as Maxima expressions

Robert Dodier <[email protected]> Tue, 28 Apr 2026 22:56:23 -0700
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <CAAsY_sT1VKxSMphdB=fEw9ta9gmnCvOGSdFOgOpojAe59gA4Kg@mail.gmail.com>
Inspired by recent discussions, I put together a proof of concept of a
representation of degrees as Maxima expressions. You can see the
result here:

https://github.com/maxima-project-on-github/maxima-packages/tree/master/robert-dodier/degrees

I chose to represent degrees apart from trig functions, so trig
functions are unchanged. If you want sin of x degrees, you write
sin(degrees(x)).

Trig functions of degrees by default don't simplify; I think that's
preferable since otherwise you get a mess with factors of %pi/180
floating around. Degrees are changed into radians by calling a
function, trig_with_degrees, which changes all the degrees in an
expression into radians, and therefore enables further simplifications
of the trig functions.

Degrees can have optional minutes and seconds, e.g. degrees(45),
degrees(45, 30), degrees(45, 30, 22).

Degrees are displayed by the pretty printer with postfix Unicode
operators, e.g. 134° 56′ 12″ for degrees(134, 56, 12).

Arithmetic is allowed on degrees, although I haven't worked out how to
handle subtraction; it turns out that's a bit subtle. I'll think about
it some more.

The output from degrees.demo is shown in the README for that package.

For the record,
https://github.com/maxima-project-on-github/maxima-packages is a
package-parking place that I started a few years ago, in hope of
promoting something like the package ecosystems for other systems such
as R and Python.

All in good fun,

Robert


_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss