Complex<T>.RootOfUnity Method

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

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
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

ArgumentOutOfRangeException

degree is equal to zero.

See Also