public static void Transform(ref Vector2[] points, ref Vector2 position, float angle, ref Vector2 scale, out Vector2[] list)
{
int count = points.Length;
Vector2[] array = new Vector2[count];
for (int i = 0; i < count; i++)
{
// rotate the point, and then translate.
float x = points[i].X * scale.X;
float y = points[i].Y * scale.Y;
float c = (float)Math.Cos(angle);
float s = (float)Math.Sin(angle);
array[i].X = (c * x) - (s * y) + position.X;
array[i].Y = (c * y) + (s * x) + position.Y;
}
list = array;
}