Exemplo n.º 1
0
 public void Transform(Mobius m)
 {
     Hexagon.Transform(m);
     TestCircle.Transform(m);
     CircumCircle.Transform(m);
     Isometry *= new Isometry(m, null);
 }
Exemplo n.º 2
0
        private static CircleNE[] CycleCircles(CircleNE template, Vector3D vertex0)
        {
            Mobius          m      = RotMobius(vertex0);
            List <CircleNE> result = new List <CircleNE>();

            result.Add(template);
            for (int i = 0; i < 3; i++)
            {
                CircleNE next = result.Last().Clone();
                next.Transform(m);
                result.Add(next);
            }

            return(result.ToArray());
        }
Exemplo n.º 3
0
        public void SetupHexagonForKQ()
        {
            Polygon centralTile = new Polygon();

            centralTile.CreateRegular(7, 3);
            Vector3D vertex0 = centralTile.Segments[0].P1;

            CircleNE[] otherThreeSides = OtherThreeSides();
            CircleNE[] systoles        = SystolesForKQ();

            // Calc verts.
            List <Vector3D> verts = new List <Vector3D>();
            Vector3D        t1, t2;

            Euclidean2D.IntersectionCircleCircle(otherThreeSides[0], systoles[0], out t1, out t2);
            Vector3D intersection = t1.Abs() < 1 ? t1 : t2;

            verts.Add(intersection);
            intersection.Y *= -1;
            verts.Add(intersection);
            Mobius m = RotMobius(vertex0);

            verts.Add(m.Apply(verts[0]));
            verts.Add(m.Apply(verts[1]));
            verts.Add(m.Apply(verts[2]));
            verts.Add(m.Apply(verts[3]));

            // Setup all the segments.
            bool clockwise = true;

            Hexagon.Segments.AddRange(new Segment[]
            {
                Segment.Arc(verts[0], verts[1], otherThreeSides[0].Center, clockwise),
                Segment.Arc(verts[1], verts[2], systoles[1].Center, clockwise),
                Segment.Arc(verts[2], verts[3], otherThreeSides[1].Center, clockwise),
                Segment.Arc(verts[3], verts[4], systoles[2].Center, clockwise),
                Segment.Arc(verts[4], verts[5], otherThreeSides[2].Center, clockwise),
                Segment.Arc(verts[5], verts[0], systoles[0].Center, clockwise),
            });
            Hexagon.Center = vertex0;

            // Setup the test circle.
            m.Isometry(Geometry.Hyperbolic, 0, -vertex0);
            Polygon clone = Hexagon.Clone();

            clone.Transform(m);

            Circle temp = new Circle(
                clone.Segments[0].Midpoint,
                clone.Segments[2].Midpoint,
                clone.Segments[4].Midpoint);
            CircleNE tempNE = new CircleNE(temp, new Vector3D());

            tempNE.Transform(m.Inverse());
            TestCircle = tempNE;

            temp = new Circle(
                clone.Segments[0].P1,
                clone.Segments[1].P1,
                clone.Segments[2].P1);
            tempNE = new CircleNE(temp, new Vector3D());
            tempNE.Transform(m.Inverse());
            CircumCircle = tempNE;
        }