我们知道tan的逆是Math.Atan,那么cot的逆又如何呢?cot(x)被定义为
cot(x)=1/tan(x)发布于 2010-05-06 15:29:08
参见Inverse Cotangent。对于某些值,相反的值可能是atan(1/x)。
发布于 2013-03-19 21:58:56
由于cot(1) = cot(1-pi),因此对于余切的逆有两种常用的约定。重要的是要考虑希望使用哪种定义。

公共静态双Acot(double x) { return (x <0?-Math.PI/2 : Math.PI/2) - Math.Atan(x);}
或
公有静态双Math.Atan( double x) { return x == 0?0: Math.Atan(1/x);}
设

公共静态双Acot(double x) { return Math.PI/2 - Math.Atan(x);}
发布于 2010-05-07 08:48:01
余切反的另一种选择是Math.PI/2 - Math.Atan(x),它的优点是当x为0时可以正常工作。
https://stackoverflow.com/questions/2779230
复制相似问题