Operator Library: Arithmetics
TAN 算子计算输入的正切值。
正切函数的输入范围为 [-\u221e, \u221e]。 \t\t\t由于正切函数的周期性,VisualApplets 算子的输入范围受限于 [-\u03c0, \u03c0[ \t\t\ti.e. 输入端最小值为 -\u03c0,输入端最大值加 1 为 \u03c0。 \t\t\t因此,输入端不可能出现 +\u03c0 的值。
因此,正切函数的自变量 x 由下式决定:

其中

是输入链接上的 Bit Width。
正切函数的结果范围为 [-\u221e, \u221e]。 \t\t\t此算子包含一个 ResolutionBits 参数,用于定义输出值的定点分辨率位。 \t\t\t因此,输出范围由输出位数和分辨率位数决定 =

其中

是输出端的 Bit Width,R 是分辨率位。 因此,输出值为

对于正切函数,-\u03c0/2 和 \u03c0/2 的值未定义。 \t\t\tVisualApplets 算子会将这些值裁切为输出端可能的最大值或最小值。 \t\t\t此外,正切函数的结果可能会超出输出值的范围。 \t\t\t在这种情况下,结果也会被裁切为可能的最大值或最小值。 \t\t\t因此,

下图显示了标准正切函数的曲线图。

下一张图展示了 VisualApplets 算子的实现。请注意输入和输出的 Bit Width。

| Link Parameter | Input Link I | Output Link O |
|---|---|---|
| Bit Width | [8, 12] | [8,32] |
| Arithmetic | 有符号 | 有符号 |
| Parallelism | any | as I |
| Kernel Columns | 1 | as I |
| Kernel Rows | 1 | as I |
| Img Protocol | {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} | as I |
| Color Format | VAF_GRAY | as I |
| Color Flavor | FL_NONE | as I |
| Max. Img Width | any | as I |
| Max. Img Height | any | as I |
以下示例展示了 TAN 算子的使用:
-
'Functional Example for Specific Operators of Library Arithmentics: Trigonometric Functions'
Examples - Demonstration of how to use the operator

上一页

