Trigonometric
MathTrigonometric 方块在单个可配置方块中提供 7 种三角函数:
- sin(x) - 正弦
- cos(x) - 余弦
- tan(x) - 正切
- asin(x) - 反正弦
- acos(x) - 反余弦
- atan(x) - 反正切
- atan2(y,x) - 双参数反正切
数学模型
输入与输出
| Direction | ID | Label | 类型 | Status |
|---|---|---|---|---|
| → In | in |
Input | number | Required |
| → In | in2 |
X (atan2) | number | Required |
| ← Out | out |
Output | number | Output |
参数
| 参数 | Label | 类型 | 默认值 | 描述 |
|---|---|---|---|---|
function |
Function | select | sin |
使用示例
正弦波生成
Ramp (0 to 2π) → Trigonometric(sin) → uPlotDisplay
使用 atan2 进行全角度恢复
sin_signal → Trigonometric(atan2) ← cos_signal
↓
Angle (radians)说明与最佳实践
- 角度单位:所有三角函数均使用弧度;可通过 Gain(× π/180) 将度数转换为弧度
- tan 奇异点:tan(x) 在 x = π/2 + nπ 处趋于 ±∞;若信号穿过这些点,可在 tan 后放置 Saturation 方块
- atan2:双参数反正切可从 (y, x) 坐标恢复完整角度 (−π, π];将 y 连接到
in,x 连接到in2 - asin/acos 限幅:超出 [−1, 1] 的输入值会被自动截断限幅;可在前端连接 Saturation 方块以获得显式边界
- 周期性输出:sin/cos 输出被限制在 [−1, 1] 之间;可通过 Gain 进行缩放以匹配信号范围
相关模块
Gain,Saturation- 信号调理SignalGenerator- 替代正弦信号源MathFunction- 其他数学运算