Complex<T>.RootOfUnity Method

Returns a complex number that is the specified root of unity of the specified degree.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public static Complex<T> RootOfUnity(
	int degree,
	int index
)

Parameters

degree  Int32
The degree of the root.
index  Int32
The index of the root.

Return Value

Complex<T>
A complex number that is the indexth root of unity of degree degree.

Remarks

The roots of unity are the solutions to the equation zn= R.One, with n the degree, which cannot be zero. There are exactly n solutions to this equations. Together, they give the coordinates of a regular n-sided polygon with its center at the origin, its vertices at unit distance from the origin, and its first vertex on the real axis.

This method returns the roots of the specified degree in counter-clockwise order. The index can be any integer value.

This method requires that the operand type supports real arithmetic.

Exceptions

ArgumentOutOfRangeExceptiondegree is equal to zero.

See Also