Operator COT

Operator Library: Arithmetics

COT 運算子會計算輸入的餘切值。

餘切函數的輸入範圍為 [-∞, ∞]。 由於餘切函數具有週期性,VisualApplets 運算子的輸入範圍被限制在 [-π, π[ 亦即輸入的最小值為 -π,而輸入的最大值加 1 則為 π。 因此,輸入值不可能為 +π。

因此,餘切函數的引數 x 由以下決定

其中

is the bit width at the input link.

餘切函數的結果範圍在 [-∞, ∞]。 此運算子包含一個 ResolutionBits 參數,用於定義輸出值的定點解析度位元。 因此,輸出範圍由輸出位元數與解析度位元決定 =

其中

為輸出的 Bit Width,而 R 則為解析度位元。 因此,輸出值為

正切函數未定義 -π/2 與 π/2。 VisualApplets 運算子會將這些值裁切至輸出的最大或可能最小值。 此外,餘切函數的結果也可能會超出輸出值範圍。 在這種情況下,結果同樣會被裁切至最大或可能最小值。 因此,

下圖顯示了一般餘切函數的繪圖。

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

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

參數

ResolutionBits
Type 靜態寫入參數
Default 8
Range [0, OutputBitWidth]

此參數如上述說明,用於定義輸入值的精確度。

使用範例

以下範例顯示了 COT 運算子的使用方式: