我想了解三角学,简短的回答是我不了解。
我画了一个小三角形来摆弄,然后问自己一个问题:“如果我知道斜边和角度的长度,我如何找到其他边的长度?”。
然后我开始读书。显然,角 A 的正弦值应该等于对边的长度除以斜边的长度。所以我想,使用直角三角形,将斜边的长度乘以角度的正弦值就可以得到对边的长度。
1.414 / 1 = .707blahblah * 1.414 = 1 在我的计算器上。
但在每种编程语言中,我都会尝试 sin(45.0) 等于 .8somethingsomething。我尝试了 c++、c#、java、php 和 lua。
输入没有被解释为度数吗?使用什么单位以及如何转换它?我一直看到弧度这个词,如果有人能解释弧度是什么,那将会很有帮助。
I am trying to understand trigonometry and the short answer is that I do not.
I drew a little triangle to mess around with and I asked myself the question, "If I know the length of the hypotenuse and the angle, how do I find the length of the other edges?".
Then I started reading. Apparently, the sine of angle A is supposed to equal the length of the opposite side divided by the length of the hypotenuse. So I figured that, using a right triangle, multiplying the length of the hypotenuse by the sine of the angle would yield the length of the opposing side.
1.414 / 1 = .707blahblah * 1.414 = 1 on my calculator.
But in every programming language I try sin(45.0) equals .8somethingsomething. I tried c++, c#, java, php, and lua.
Is the input not being interpreted as degrees? What unit is being used and how do I convert it? I've been seeing the word Radians, it would be helpful if someone could explain what a Radian is.
发布评论
评论(6)
弧度是角度测量单位,与度一样,只不过圆中有 360 度,而圆中有 2*pi(约 6.28)弧度。您可以通过乘以 pi (3.14159) 再除以 180 将度数转换为弧度。
如果三角形是直角三角形,则该公式有效,是的,大多数编程语言都希望将弧度而不是度数作为参数函数如
sin()
和cos()
。关于下面评论中的论点:如果固定角度不能完全确定一个三角形。
Radians are units of angular measure, like degrees, except that while there are 360 degrees in a circle, there are 2*pi (about 6.28) radians in a circle. You can convert degrees to radians by multiplying by pi (3.14159) and dividing by 180.
The formula works if the triangle is a right triangle, and yes, most programming languages expect radians rather than degrees as arguments to functions like
sin()
andcos()
.Regarding the argument in the comments below: if you fix angle <BAC, side AB, and side BC, you can see that there are two possible positions for point C which preserve the the length D2 for side BC. Therefore <BAC, D1, and D2 do not fully determine a triangle.
sin
函数的输入通常以弧度为单位,而不是度数。例如,在 Java 中 sin 的 >documentation 指出:首先将角度(以度为单位)乘以 pi/180,转换为弧度
The input to
sin
functions generally is expected in radians, not degrees. For example, in the Java documentation forsin
it's stated that:Convert the angle in degrees to radians first, by multiplying it by pi/180
弧度是圆的半径沿其圆周的距离。由于圆的周长是 pi 乘以半径的 2 倍,因此一个完整的圆中有 2 倍 pi 的弧度。
A radian is the distance of the radius of a circle along its circumference. Since a circle's circumference is 2 times pi times its radius, there are 2 times pi radians in one complete circle.
是的,你是对的。这些函数都以弧度而不是度数作为输入。
您可以通过将度数乘以 π/180 将度数转换为弧度。
Yes, you are correct. Those functions all take their input in radians, not degrees.
You can convert degrees to radians by multiplying the degrees by π/180.
转换为弧度:弧度=度/180*Pi
Convert to radians: Radian = degree/180*Pi
要将度数转换为弧度,请将度数除以 180,然后乘以 pi。
In order to convert from degrees to radians, divide the number in degrees by 180 and multiply by pi.