CircleGetAngleAtSliceIndex Method

Given a circle sliced symmetrically into multiple equal slices with a reference to 0 degrees, return the starting angle of the slice at the specified index, in radians.

Definition

Namespace: Geometry
Assembly: Geometry (in Geometry.dll) Version: 25.2414.4032
C#
public static float GetAngleAtSliceIndex(
	int slices,
	int index
)

Parameters

slices  Int32
Count of slices defined in the circle.
index  Int32
The index of the slice at which to retrieve the starting angle.

Return Value

Single
The angle within the circle at which the specified slice begins. Index 0 will always return zero, the beginning of any slice of the circle.

Remarks

This method will return correct values for negative indices and indices greater than the number of slices defined, to support cases where a scenario includes multiple turns in either direction.

If your case might include a multi-turn scenario, consider calling Trig.NormalizeRad on the result of this method to maintain an angle less than a single turn.

See Also