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

NoncentralMoments() public static method

Computes the complex circular non-central moments of the given circular angles.
public static NoncentralMoments ( double angles, int order ) : Complex
angles double
order int
return Complex
        public static Complex NoncentralMoments(double[] angles, int order)
        {
            double cbar = 0;
            double sbar = 0;

            for (int i = 0; i < angles.Length; i++)
            {
                cbar += Math.Cos(angles[i] * order);
                sbar += Math.Sin(angles[i] * order);
            }

            return new Complex(cbar, sbar);
        }
    }