ComplexMathRootsOfUnity Method

Computes the nth roots of unity.

Definition

Namespace: Meta.Numerics
Assembly: Meta.Numerics (in Meta.Numerics.dll) Version: 4.2.0+6d77d64445f7d5d91b12e331399c4362ecb25333
C#
public static Complex[] RootsOfUnity(
	int n
)

Parameters

n  Int32
The order of roots to be computed, which must be positive.

Return Value

Complex
The n complex numbers x such that xn = 1.

Remarks

The roots are listed in the usual anti-clockwise order, starting from 1.

This method ensures that 1 and -1 (when it appears) are exact, and that conjugate roots are exactly conjugate.

See Also