Exemplo n.º 1
0
        public void CompositeTransformation()
        {
            //var figure = new Cartesian2DPoints(new List<Point>{new Point(-1,-8)});
            var figure = new Cartesian2DPoints("(-1,8)");
            Cartesian2DPoints transformedFigure = figure.Reflect(LineType.Y_axis); //(1,8)

            transformedFigure = transformedFigure.Translate("4|6");                //(5,14)
            string result = transformedFigure.ToString();

            Assert.AreEqual(result, "(5,14)");
        }
Exemplo n.º 2
0
        public void CompositeTransformationTriangle()
        {
            var figure = new Cartesian2DPoints("(-3.5,4)(-7,-3)(0,-3)");

            figure = figure.Translate("7|3");
            figure = figure.Reflect(LineType.X_axis);

            var expected = new Cartesian2DPoints("(3.5,-7)(0,0)(7,0)");
            var areEqual = figure.Equals(expected);

            Assert.IsTrue(areEqual);
        }