Accord.Statistics.Circular.Sum C# (CSharp) Method

Sum() public static method

Computes the sum of cosines and sines for the given angles.
public static Sum ( double angles, double &cos, double &sin ) : void
angles double A double array containing the angles in radians.
cos double The sum of cosines, returned as an out parameter.
sin double The sum of sines, returned as an out parameter.
return void
        public static void Sum(double[] angles, out double cos, out double sin)
        {
            cos = 0;
            sin = 0;

            for (int i = 0; i < angles.Length; i++)
            {
                cos += Math.Cos(angles[i]);
                sin += Math.Sin(angles[i]);
            }
        }