level 14
VenoM♤
楼主
如题。
做作业的时候遇到这个问题,希望能帮到同样困惑的盆友:)
转一个pbr的时候某个地方需要用到反正切,节点编辑器里有两个:arctan2和arctangent,
官方文档的说明是:
ArcTan2
Returns the arc-tangent of Input 1 and Input 2. When Radians is selected, the output range will be between -PI/2 and PI/2, otherwise -90 and 90 degrees.
返回输入1和输入2的反正切值。当选择弧度时,输出范围将在 -PI/2和 PI/2之间,否则为 -90和90度。
ArcTangent
Returns the arc-tangent of Input. When Radians is selected, the output range will be between -PI/2 and PI/2, otherwise -90 and 90 degrees.
返回输入的反正切。当选择弧度时,输出范围将在 -PI/2和 PI/2之间,否则为 -90和90度。
两者一样,只有输入端有区别
;
========================================================================
然后我对arctan的输出结果加上某个数值,再看输出,直到我加到3.1纯黑色(=0)基本消失,那也即意味着,
arctan2基本应该是最小到-pi:

而加到-3.1时输出几乎全黑,也即,arctan2最大输出应该是pi:

于是我百度了arctan2:
「返回值atan2函数返回的是原点至点(x,y)的方位角,即与 x 轴的夹角。也可以理解为复数 x+yi 的辐角。返回值的单位为弧度,取值范围为(-pi,pi) 」
和测试结果吻合
2022年02月21日 21点02分
1
做作业的时候遇到这个问题,希望能帮到同样困惑的盆友:)
转一个pbr的时候某个地方需要用到反正切,节点编辑器里有两个:arctan2和arctangent,
官方文档的说明是:
ArcTan2
Returns the arc-tangent of Input 1 and Input 2. When Radians is selected, the output range will be between -PI/2 and PI/2, otherwise -90 and 90 degrees.
返回输入1和输入2的反正切值。当选择弧度时,输出范围将在 -PI/2和 PI/2之间,否则为 -90和90度。
ArcTangent
Returns the arc-tangent of Input. When Radians is selected, the output range will be between -PI/2 and PI/2, otherwise -90 and 90 degrees.
返回输入的反正切。当选择弧度时,输出范围将在 -PI/2和 PI/2之间,否则为 -90和90度。
两者一样,只有输入端有区别
========================================================================
然后我对arctan的输出结果加上某个数值,再看输出,直到我加到3.1纯黑色(=0)基本消失,那也即意味着,
arctan2基本应该是最小到-pi:

而加到-3.1时输出几乎全黑,也即,arctan2最大输出应该是pi:
于是我百度了arctan2:「返回值atan2函数返回的是原点至点(x,y)的方位角,即与 x 轴的夹角。也可以理解为复数 x+yi 的辐角。返回值的单位为弧度,取值范围为(-pi,pi) 」
和测试结果吻合