Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

cot

角的余切(以弧度为单位)

说明

示例

Y = cot(X) 返回 X 的各元素的余切。cot 函数按元素处理数组。该函数同时接受实数和复数输入。

  • 对于 X 的实数值,cot(X) 返回区间 [-∞, ∞] 内的实数值。

  • 对于 X 的复数值,cot(X) 返回复数值。

示例

全部折叠

在域 -π<x<00<x<π 上绘制余切函数。

x1 = -pi+0.01:0.01:-0.01; 
x2 = 0.01:0.01:pi-0.01;
plot(x1,cot(x1),x2,cot(x2)), grid on

Figure contains an axes object. The axes object contains 2 objects of type line.

计算复角在向量 x 中的余切。

x = [-i pi+i*pi/2 -1+i*4];
y = cot(x)
y = 1×3 complex

   0.0000 + 1.3130i  -0.0000 - 1.0903i  -0.0006 - 0.9997i

输入参数

全部折叠

以弧度为单位的输入角度,指定为标量、向量、矩阵、多维数组、表或时间表。

数据类型: single | double | table | timetable
复数支持:

输出参数

全部折叠

输入角的余切,以实数值或复数值标量、向量、矩阵或多维数组、表或时间表形式返回。

详细信息

全部折叠

余切函数

通过引用直角三角形定义的角的余切 α 是

cot(α)=1tan(α)=adjacent sideopposite side=ba.

.

Right triangle with vertices A, B, and C. The vertex A has an angle α, and the vertex C has a right angle. The hypotenuse, or side AB, is labeled as h. The opposite side of α, or side BC, is labeled as a. The adjacent side of α, or side AC, is labeled as b. The cotangent of α is defined as the adjacent side b divided by the opposite side a.

复数参数的余切 α 是

cot(α)=i(eiα+eiα)(eiαeiα).

.

提示

  • 在浮点算术运算中,cot 是有界函数。也就是说,在输入为 pi 倍数的发散点处,cot 不会返回 Inf-Inf 值,而是返回一个模很大的数。这是由于 π 的浮点表示不够准确。

扩展功能

C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。

GPU 代码生成
使用 GPU Coder™ 为 NVIDIA® GPU 生成 CUDA® 代码。

版本历史记录

在 R2006a 之前推出

全部展开

另请参阅

| | | |