Operator SIN

Operator Library: Arithmetics

此 operator 會計算輸入的正弦值。

正弦函數的輸入範圍為 [-∞, ∞]。 由於正弦函數具有週期性,因此該 VisualApplets operator 的輸入範圍限制為 [-π, π] 亦即,輸入的最小值為 -π,輸入的最大值加 1 為 π。 因此,輸入端不可能出現 +π 的值。

因此,正弦函數的引數 x 由以下決定

其中

is the bit width at the input link.

正弦函數的結果範圍在 [-1, 1] 內。 VisualApplets 中 operator 的輸出值範圍會對應至

其中

是輸出 link 處的 Bit Width。因此輸出值為

下圖顯示正弦函數的圖表。

下一張圖顯示了 VisualApplets Operator 的實作。請注意輸入與輸出的 Bit Width。

讓我們看一個輸入像素值。例如 -50。 給定輸入 Bit Width 為 8,該像素值的實際值表示法為 -50 * pi / 128。 正弦計算結果將為 -0.94。 在像素值表示法中,此結果變為 -121,這與圖表中顯示的相同。

I/O Properties

Property Value
Operator Type O
Input Link I, data input
Output Link O, data output

支援的 Link 格式

Link Parameter Input Link I Output Link O
Bit Width [8, 12] [8, 32]
Arithmetic signed signed
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

參數

無

使用範例

以下範例顯示 operator SIN 的使用方式: