[Community Puzzle] Darts

Can you specify what you mean by “SIZE”? Is this perimeter, area, a side?

It means a side. I’ve also just updated the statement to clarify that.

I’ve added 4 new pairs of cases to improve robustness, since some submitted solutions passed the original cases but would fail the new ones.

One way to fix this code:
You need to rotate by 45 degrees instead of 90, which corresponds to Math.PI / 4.
The length of the side of the diamond after rotation is SIZE * Math.Sqrt(2) / 2

Lines 39 to 44 become:
                float[] point = RotateAroundOrigin(X, Y, (float) Math.PI / 4);

                if (Math.Abs(point[0]) <= SIZE * Math.Sqrt(2) / 4f && Math.Abs(point[1]) <= SIZE * Math.Sqrt(2) / 4f) // Within diamond
                {
                    score += 5;   
                }
            }