Beispiel #1
0
        public static void Create(E.Vector Pos, Models.Polygon Model, GphW3.CanvasPlotter Plotter)
        {
            Model.PolygonBlock.Clear();

            Model.StartsAt(new E.Vector(0, 0) + Pos);
            Model.LineTo(new E.Vector(100, 0) + Pos);
            Model.LineTo(new E.Vector(100, 100) + Pos);
            Model.LineTo(new E.Vector(0, 100) + Pos);
            Model.LineTo(new E.Vector(0, 0) + Pos);
            Model.LineTo(new E.Vector(100, 100) + Pos);

            Model.PolygonBlock.draw(Plotter);
        }
Beispiel #2
0
        public static void Create(double Vergrößerungsfaktor, Models.Polygon Model, GphW3.CanvasPlotter Plotter)
        {
            var v = new E.Vector(500, 400);

            Model.Clear();
            Model.StartsAt(v);

            Css.Color[] colors = { Css.Color.Green, Css.Color.Lime, Css.Color.Orange, Css.Color.Aqua };

            for (int phi = 0, ci = 0; phi < 360; phi += 4, ci++)
            {
                var vs    = new E.Vector(100, 0);
                var rot   = new E.Transformations.RotationInCylindricalCoordinates(2, phi * Math.PI / 180.0, 0, 1);
                var scale = new E.Transformations.Scale(Vergrößerungsfaktor * phi / 360.0, 1);

                var vrand = rot.apply(scale.apply(vs)) + v;

                Model.LineTo(vrand, colors[ci % colors.Length]);
            }

            Model.PolygonBlock.draw(Plotter);
        }