public static Mobius ReflectionAcrossLine(Complex l0, Complex l1)
        {
            var takel0ToOrigin = Translation(-l0.Real, -l0.Imaginary);
            var takeOriginTol0 = Translation(l0.Real, l0.Imaginary);

            Complex l1_               = takel0ToOrigin.Apply(l1);
            double  angle             = Math.Atan2(l1_.Imaginary, l1_.Real);
            Mobius  rotatel1_ToXAxis  = Rotation(-angle);
            Mobius  rotateXAxisTol1_  = Rotation(angle);
            Mobius  reflectAboutXAxis = new Mobius(a: Complex.One, b: Complex.Zero, c: Complex.Zero, d: Complex.One, R: -1);

            Mobius result = takeOriginTol0 * rotateXAxisTol1_ * reflectAboutXAxis * rotatel1_ToXAxis * takel0ToOrigin;

            return(result);
        }
Exemplo n.º 2
0
        public void Rotate(Point point, Point previusPoint)
        {
            int    dirY = (point.Y > previusPoint.Y) ? 1 : -1;
            int    dirX = (point.X > previusPoint.X) ? 1 : -1;
            double incY = Math.Abs(point.Y - previusPoint.Y) / Disk.Radius;
            double incX = Math.Abs(point.X - previusPoint.X) / Disk.Radius;

            var isometry = Mobius.Rotation(dirY * incY);

            for (int i = 0; i < Points.Count; ++i)
            {
                Complex newP = isometry.Apply(Vector2Complex(Points[i]));
                Points[i] = Complex2Vector(newP);
            }
        }