在 Mathematica 8 中将度数设置为默认值

发布于 2024-12-18 20:29:39 字数 29 浏览 1 评论 0原文

是否可以将三角函数设置为使用度数而不是弧度?

Is it possible to set the trigonometric functions to use degrees instead of radians?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月亮邮递员 2024-12-25 20:29:39

简短回答

不,这是不可能的。我建议定义替代函数,并使用这些函数:sinDeg[d_] := Sin[d Degree]。或者直接使用DegreeSin[30 Degree]。 (也可以尝试输入ESC deg ESC。)

更长的答案

您可以取消保护函数,并使用Gayley-Villegas 技巧,但这很可能会破坏 Mathematica 中的一些功能,因为我预计它会在内部使用这些函数。

由于这是一件令人讨厌的事情,所以我不会提供代码示例,而是让您根据上面的链接来弄清楚。 :-)

Short answer

No, this is not possible. I'd suggest to define alternative functions, and work with those: sinDeg[d_] := Sin[d Degree]. Or just use Degree explicitly: Sin[30 Degree]. (Try also entering ESC deg ESC.)

Longer answer

You can Unprotect the functions, and re-define them using the Gayley-Villegas trick, but this is very likely to break several things in Mathematica, as I expect it is using these functions internally.

Since this is such a nasty thing to do, I'm not going to give a code example, instead I'll leave it to you to figure out based on my link above. :-)

酒解孤独 2024-12-25 20:29:39

我认为输出是基于输入的。例如,Cos[60 Degree] 将以度为单位输出。

I think the output is based on the input. So for example Cos[60 Degree] will output in degrees.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文