当我试图用两种不同的方法计算齐次矩阵时,有一个非常小的矩阵。
差异,0和0.0000000000000061229677524420688位于这两种物质的同一位置。
数字0.00000000000061229677524420688非常接近0,所以我把它们当作
同样的号码。我认为如果插入Atan2(,),答案应该是相同的。
但出乎意料的是,答案完全不同。以下是代码段:
Dim b = Atan2(0.000000000000000061229677524420688, 0)
Dim c = Atan2(0, 0)在编译器中运行代码后,b为1.57096,c为0。
发布于 2022-01-22 15:15:43
您的atan2参数在数学意义上是无效的,对于这两个零都是未定义函数。
请注意,第一个参数应该是r*sin(fi),第二个参数r*cos(fi)表示某些角fi和r>0。
在dotnet 规则是中--注意,在第4种情况下,它们分配了0,而人们可能会期望NaN或某些错误:
For points on the boundaries of the quadrants, the return value is the following:
If y is 0 and x is not negative, θ = 0.
If y is 0 and x is negative, θ = π.
If y is positive and x is 0, θ = π/2.
If y is negative and x is 0, θ = -π/2.
If y is 0 and x is 0, θ = 0.你的价值符合第五箱和第三箱
https://stackoverflow.com/questions/70813496
复制相似问题