# Mathematica in degrees mode

How can I tell Mathematica to evaluate all expressions, plot all functions, solve all equations in degrees, instead of radians?

• – corey979 Dec 21 '16 at 13:10
• @corey979 what does that mean? – teed Dec 21 '16 at 13:11
• @corey979 i mean like the option in scientific calculators. – teed Dec 21 '16 at 13:13
• So, you want the result of D[Sin[x], x] to be π Cos[x]/180? In the meantime: Plot[Sin[x °], {x, 0, 360}]. – J. M. will be back soon Dec 21 '16 at 13:17

Possibly a bad idea for the reasons mentioned in previous messages, but you could do something like the following:

SetAttributes[trigMode, HoldAllComplete];
trigMode[expr_] :=
Unevaluated[expr] /.
{(f : ArcSin | ArcCos | ArcTan | ArcCot | ArcSec | ArcCsc)[x_] :> 180 f[x]/π,
(f : Sin | Cos | Tan | Cot | Sec | Csc)[x_] :> f[x °]};

$Pre = trigMode; Sin[90] (* 1 *) ArcSin[Sqrt[3]/2] (* 60 *) Plot[Sin[x], {x, 0, 360}]  I used $Pre to make sure my function trigMode is applied to every input expression. It was important that the function has the attribute HoldAllComplete (so it doesn't evaluate on me and therefore ArcSin[Sqrt[3]/2] doesn't get transformed to π/3 before I have a chance to catch it and apply a transformation rule). trigMode uses some pattern matching to find parts of the expression that contain "trig functions" and makes sure they get treated like a calculator in "degree mode" would.

When you want to go back to the standard mode, use $Pre = . to clear. • @Mr.Wizard sure thing. – chuy Dec 21 '16 at 22:15 • Done. Please check that I did not break anything! – Mr.Wizard Dec 21 '16 at 22:17 • @Mr.Wizard looks good to me. I knew MemberQ was a bad idea. – chuy Dec 21 '16 at 22:19 • I've added the three other pairs of trig functions; it might be sufficient for students. – J. M. will be back soon Dec 22 '16 at 1:52 Sin[60 Degree] $\frac{\sqrt{3}}{2}\$

Plot[Sin[alpha Degree], {alpha, 0, 360}]


ToDeg[rad_] := N[rad/Degree];
FromDeg[deg_] := N[Degree deg];

ToDeg[ArcSin[Sqrt[3]/2]]
60.


• Isn't there a feature to set it in degrees without putting Degree after the angle so that when I input ArcSin[Sqrt[3]/2], the answer will be 60? – teed Dec 21 '16 at 13:23
• I doubt that. Consider ArcSin[2.] - how do you want to express complex numbers in degrees? – corey979 Dec 21 '16 at 13:27
• @corey: I agree, and additionally, should Exp[180 I] be -1, in such a case? – J. M. will be back soon Dec 21 '16 at 13:29
• Or try with UnitConvert. – corey979 Dec 21 '16 at 13:31