Skip to content

Latest commit

 

History

History
84 lines (52 loc) · 3.58 KB

TAMath.Cos.md

File metadata and controls

84 lines (52 loc) · 3.58 KB

TAMath.Cos Method

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.

TAMath.Cos(int, int, double[]) Method

Calculates the trigonometric cosine of each element in the input array.

public static TechnicalAnalysis.Functions.CosResult Cos(int startIdx, int endIdx, double[] real);

Parameters

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.

Returns

CosResult
A CosResult containing the calculated cosine values.

Remarks

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].

TAMath.Cos(int, int, float[]) Method

Calculates the trigonometric cosine of each element in the input array.

public static TechnicalAnalysis.Functions.CosResult Cos(int startIdx, int endIdx, float[] real);

Parameters

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.

Returns

CosResult
A CosResult containing the calculated cosine values.

Remarks

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.