numpy.sin函数的度数? [英] numpy.sin function in degrees?

查看:74
本文介绍了numpy.sin函数的度数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个与计算折射角有关的问题,而不是与之有关的问题.但是,看来我无法按度使用numpy.sin()函数.我尝试使用numpy.degrees()和numpy.rad2deg().

I'm working on a problem that has to do with calculating angles of refraction and what not. However, it seems that I'm unable to use the numpy.sin() function in degrees. I have tried to use numpy.degrees() and numpy.rad2deg().

numpy.sin(90)

numpy.degrees(numpy.sin(90))

两者的回报率分别为〜0.894和〜51.2.

Both return ~ 0.894 and ~ 51.2 respectively.

感谢您的帮助.

推荐答案

您不想将转换为度,因为您已经有了90度的数字.您需要将90度从角转换为弧度,并且需要在正弦之前进行:

You don't want to convert to degrees, because you already have your number (90) in degrees. You need to convert 90 from degrees to radians, and you need to do it before you take the sine:

>>> np.sin(np.deg2rad(90))
1.0

(您可以使用 deg2rad radians .)

这篇关于numpy.sin函数的度数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆