public void TestQuadOrientation(bool normalised)
        {
            Quad quad = normalised
                ? new Quad(Vector2.Zero, new Vector2(1, 0), new Vector2(0, 1), Vector2.One)
                : new Quad(new Vector2(0, 1), Vector2.One, Vector2.Zero, new Vector2(1, 0));

            float orientation = Vector2Extensions.GetOrientation(quad.GetVertices());

            Assert.That(orientation, Is.EqualTo(normalised ? 2 : -2).Within(0.001));
        }
        public void TestArrayOrientation(bool clockwise)
        {
            var vertices = new[]
            {
                new Vector2(0, 1),
                Vector2.One,
                new Vector2(1, 0),
                Vector2.Zero
            };

            if (!clockwise)
            {
                Array.Reverse(vertices);
            }

            float orientation = Vector2Extensions.GetOrientation(vertices);

            Assert.That(orientation, Is.EqualTo(clockwise ? 2 : -2).Within(0.001));
        }
 private void assertPolygonEquals(IPolygon expected, IPolygon actual, bool reverse)
 => Assert.That(Vector2Extensions.GetOrientation(actual.GetVertices()),
                reverse
             ? Is.EqualTo(-Vector2Extensions.GetOrientation(expected.GetVertices()))
             : Is.EqualTo(Vector2Extensions.GetOrientation(expected.GetVertices())));