public static void PositionPointsInCircle(Vector2[] points, float radius, float sweep)
{
int count = points.Length;
sweep = Math.Clamp(sweep, 0f, 1f);
float totalAngle = 2 * MathF.PI * sweep;
float angleIncrement = totalAngle / (count - 1);
for (int i = 0; i < count; i++)
{
float angle = i * angleIncrement;
points[i] = new Vector2(
radius * MathF.Cos(angle),
radius * MathF.Sin(angle)
);
}
}
public static void PositionPointsInCircle(Vector2[] points, float radius, float sweep)
{
int count = points.Length;
sweep = Math.Clamp(sweep, 0f, 1f);
float totalAngle = 2 * MathF.PI * sweep;
float angleIncrement = totalAngle / (count - 1);
for (int i = 0; i < count; i++)
{
float angle = i * angleIncrement;
points[i] = new Vector2(
radius * MathF.Cos(angle),
radius * MathF.Sin(angle)
);
}
}