Skip to content

Latest commit

 

History

History
87 lines (55 loc) · 4.1 KB

TAMath.Sin.md

File metadata and controls

87 lines (55 loc) · 4.1 KB

TAMath.Sin Method

Overloads
Sin(int, int, double[]) Calculates the trigonometric sine for each element in the input array.
Sin(int, int, float[]) Calculates the trigonometric sine for each element in the input array.

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

Calculates the trigonometric sine for each element in the input array.

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

Parameters

startIdx System.Int32

The starting index for the calculation within the array.

endIdx System.Int32

The ending index for the calculation within the array.

real System.Double[]

An array of real values (in radians) to calculate the sine for.

Returns

SinResult
A SinResult containing the calculated sine values, along with the starting index of the result and the number of elements generated.

Remarks

The sine function takes input values in radians and returns values in the range [-1, 1]. In technical analysis, trigonometric functions are often used in cycle analysis and for generating oscillating indicators. To convert degrees to radians, multiply by π/180.

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

Calculates the trigonometric sine for each element in the input array.

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

Parameters

startIdx System.Int32

The starting index for the calculation within the array.

endIdx System.Int32

The ending index for the calculation within the array.

real System.Single[]

An array of real values (in radians) to calculate the sine for.

Returns

SinResult
A SinResult containing the calculated sine values, along with the starting index of the result and the number of elements generated.

Remarks

This overload accepts float values for convenience and internally converts them to double precision before performing the calculation. This may result in minor precision differences compared to using double values directly.