perpendicular() private méthode

private perpendicular ( Vector2 original ) : Vector2
original Microsoft.Xna.Framework.Vector2
Résultat Microsoft.Xna.Framework.Vector2
        public static void drawCircle(
            this SpriteBatch spriteBatch,
            Vector2 position,
            float radius,
            Color color,
            float thickness = 1f,
            int resolution  = 12)
        {
            var last  = Vector2.UnitX * radius;
            var lastP = Vector2Ext.perpendicular(last);

            for (int i = 1; i <= resolution; i++)
            {
                var at  = Mathf.angleToVector(i * MathHelper.PiOver2 / resolution, radius);
                var atP = Vector2Ext.perpendicular(at);

                drawLine(spriteBatch, position + last, position + at, color, thickness);
                drawLine(spriteBatch, position - last, position - at, color, thickness);
                drawLine(spriteBatch, position + lastP, position + atP, color, thickness);
                drawLine(spriteBatch, position - lastP, position - atP, color, thickness);

                last  = at;
                lastP = atP;
            }
        }
        public static void drawCircle(
            this Batcher batcher,
            Vector2 position,
            float radius,
            Color color,
            float thickness = 1f,
            int resolution  = 12)
        {
            var last  = Vector2.UnitX * radius;
            var lastP = Vector2Ext.perpendicular(last);

            batcher.setIgnoreRoundingDestinations(true);
            for (int i = 1; i <= resolution; i++)
            {
                var at  = Mathf.angleToVector(i * MathHelper.PiOver2 / resolution, radius);
                var atP = Vector2Ext.perpendicular(at);

                drawLine(batcher, position + last, position + at, color, thickness);
                drawLine(batcher, position - last, position - at, color, thickness);
                drawLine(batcher, position + lastP, position + atP, color, thickness);
                drawLine(batcher, position - lastP, position - atP, color, thickness);

                last  = at;
                lastP = atP;
            }

            batcher.setIgnoreRoundingDestinations(false);
        }