| Overloads | |
|---|---|
| Cos(int, int, double[]) | Calculates the trigonometric cosine of each element in the input array. |
| Cos(int, int, float[]) | Calculates the trigonometric cosine of each element in the input array. |
Calculates the trigonometric cosine of each element in the input array.
public static TechnicalAnalysis.Functions.CosResult Cos(int startIdx, int endIdx, double[] real);startIdx System.Int32
The starting index for the calculation.
endIdx System.Int32
The ending index for the calculation.
real System.Double[]
The input array of values in radians.
CosResult
A CosResult containing the calculated cosine values.
This function computes the cosine for each element in the input array. The input values are expected to be in radians. The output values will be in the range [-1, 1].
Calculates the trigonometric cosine of each element in the input array.
public static TechnicalAnalysis.Functions.CosResult Cos(int startIdx, int endIdx, float[] real);startIdx System.Int32
The starting index for the calculation.
endIdx System.Int32
The ending index for the calculation.
real System.Single[]
The input array of values in radians.
CosResult
A CosResult containing the calculated cosine values.
This overload accepts a float array and converts it to a double array before performing the calculation. This may result in a minor performance overhead due to the conversion process.