Exemplo n.º 1
0
        public override Point Fun(Point p)
        {
            //            var r = VariationHelper.R(p);
            //            var theta = VariationHelper.Theta(p);
            //            var pp0 = Math.Sin(theta + r);
            //            var pp1 = Math.Cos(theta - r);
            //            var p0Cube = pp0 * pp0 * pp0;
            //            var p1Cube = pp1 * pp1 * pp1;
            //
            //            return new Point(
            //                r * (p0Cube + p1Cube),
            //                r * (p0Cube - p1Cube));

            var sqrt    = VariationHelper.R(p);
            var preAtan = VariationHelper.PreAtan(p);
            var sin     = Math.Sin(preAtan + sqrt);
            var cos     = Math.Cos(preAtan - sqrt);
            var n2      = sin * sin * sin;
            var n3      = cos * cos * cos;
            var n4      = sqrt * W;

            return(new Point(
                       n4 * (n2 + n3),
                       n4 * (n2 - n3)
                       ));
        }
Exemplo n.º 2
0
        public override Point Fun(Point p)
        {
            var preAtan = VariationHelper.PreAtan(p);
            var n2      = VariationHelper.R(p) * (P1 + _dif * (0.5 + 0.5 * Math.Sin(P3 * preAtan)));
            var n3      = Math.Sin(preAtan) * n2;
            var n4      = Math.Cos(preAtan) * n2;

            return(new Point(W * n3, W * n4));
        }
Exemplo n.º 3
0
        public override Point Fun(Point p)
        {
            var n2  = _timeSpi * (p.X + p.Y);
            var sin = Math.Sin(n2);
            var cos = Math.Cos(n2);
            var n3  = W * VariationHelper.PreAtan(p) / Math.PI;
            var x   = (sin + _cosAdd) * n3;
            var y   = (cos + _sinAdd) * n3;

            return(new Point(x, y));
        }
Exemplo n.º 4
0
        public override Point Fun(Point p)
        {
            var n2  = VariationHelper.PreAtan(p) * 0.5 + Math.PI * VariationHelper.RandomNext(2);
            var sin = Math.Sin(n2);
            var cos = Math.Cos(n2);
            var n3  = W * Math.Sqrt(VariationHelper.R(p));

            return(new Point(
                       n3 * cos,
                       n3 * sin
                       ));
        }
Exemplo n.º 5
0
        public override Point Fun(Point p)
        {
            //            var r = VariationHelper.R(p);
            //            var theta = VariationHelper.Theta(p);
            //            return new Point(
            //                r * Math.Sin(theta + r)*W,
            //                r * Math.Cos(theta - r)*W);

            var preAtan = VariationHelper.PreAtan(p);
            var sqrt    = VariationHelper.R(p);

            return(new Point(W * (Math.Sin(preAtan + sqrt) * sqrt),
                             W * (Math.Cos(preAtan - sqrt) * sqrt)));
        }
Exemplo n.º 6
0
        public override Point Fun(Point p)
        {
            //            var r = VariationHelper.R(p);
            //            var theta = VariationHelper.Theta(p);
            //            var tpi = theta / Math.PI * W;
            //            var pir = Math.PI * r;
            //            return new Point(
            //                tpi * Math.Sin(pir),
            //                tpi * Math.Cos(pir));

            var n2  = Math.PI * VariationHelper.R(p);
            var sin = Math.Sin(n2);
            var cos = Math.Cos(n2);
            var n3  = W * VariationHelper.PreAtan(p) / Math.PI;

            return(new Point(sin * n3, cos * n3));
        }
        public override Point Fun(Point p)
        {
            var precalcAtan = VariationHelper.PreAtan(p);
            var n2          = Math.Sin(2.0 * precalcAtan) + 0.25 * Math.Sin(6.0 * precalcAtan);

            if (_filled == 1)
            {
                n2 *= VariationHelper.Psi;
            }

            var n3 = Math.Sin(precalcAtan) * n2;
            var n4 = Math.Cos(precalcAtan) * n2;
            var x  = W * n3;
            var y  = W * n4;


            return(new Point(x, y));
        }
Exemplo n.º 8
0
        public override Point Fun(Point p)
        {
            var precalcAtan = VariationHelper.PreAtan(p);
            var n2          = (1.0 + 0.9 * Math.Cos(8.0 * precalcAtan)) * (1.0 + 0.1 * Math.Cos(24.0 * precalcAtan)) *
                              (0.9 + 0.1 * Math.Cos(200.0 * precalcAtan)) * (1.0 + Math.Sin(precalcAtan));
            var n3 = precalcAtan + VariationHelper.HalfPi;

            if (_filled == 1)
            {
                n2 *= VariationHelper.Psi;
            }

            var n4 = Math.Sin(n3) * n2;
            var n5 = Math.Cos(n3) * n2;
            var x  = W * n4;
            var y  = W * n5;

            return(new Point(x, y));
        }
Exemplo n.º 9
0
        public override Point Fun(Point p)
        {
            //            var r = VariationHelper.R(p);
            //            var theta = VariationHelper.Theta(p);
            //            var t = Math.PI * (C * C);
            //            var td2 = t / 2.0;
            //            double dx;
            //            double dy;
            //            if ((theta + F) % t > td2)
            //            {
            //                dx = r * Math.Cos(theta - td2);
            //                dy = r * Math.Sin(theta - td2);
            //            }
            //            else
            //            {
            //                dx = r * Math.Cos(theta + td2);
            //                dy = r * Math.Sin(theta + td2);
            //            }
            //            return new Point(W*dx, W*dy);

            var getXyCoeff20 = E;
            var getXyCoeff21 = F;

            var n2 = Math.PI * getXyCoeff20 * getXyCoeff20 + 1.0E-300;
            var n3 = n2 * 0.5;

            var    preAtan = VariationHelper.PreAtan(p);
            double n4;

            if (preAtan + getXyCoeff21 - (int)((preAtan + getXyCoeff21) / n2) * n2 > n3)
            {
                n4 = preAtan - n3;
            }
            else
            {
                n4 = preAtan + n3;
            }
            var sin = Math.Sin(n4);
            var cos = Math.Cos(n4);
            var n5  = W * VariationHelper.R(p);

            return(new Point(n5 * cos, n5 * sin));
        }
Exemplo n.º 10
0
        public override Point Fun(Point p)
        {
            //            var r = VariationHelper.R(p);
            //            var tr = VariationHelper.Theta(p) * r;
            //            var sin = _xMath.Sin(tr);
            //            var cos = _xMath.Sin(HalfPi - tr);
            //            return new Point(r * sin, r * -cos);

            //            return new Point(
            //                r * Math.Sin(tr),
            //                r * -Math.Cos(tr));

            var r   = VariationHelper.R(p);
            var q   = VariationHelper.R(p) * VariationHelper.PreAtan(p);
            var sin = Math.Sin(q);
            var cos = Math.Cos(q);
            var n2  = r * W;

            return(new Point(n2 * sin, -(n2 * cos)));
        }
Exemplo n.º 11
0
        public override Point Fun(Point p)
        {
            //            var p1 = Math.PI * (P1 * P1);
            //            var theta = VariationHelper.Theta(p);
            //            var t = theta + P2 - p1 * VariationHelper.Trunc(2.0 * theta * P2 / p1);
            //            var r = VariationHelper.R(p);
            //            var q = p1 / 2.0;
            //            return t > q
            //                ? new Point(r * Math.Sin(theta - q), r * Math.Cos(theta - q))
            //                : new Point(r * Math.Sin(theta + q), r * Math.Cos(theta + q));

            var    sqrt = VariationHelper.R(p);
            double preAtan;

            if (p.X < -1.0E-300 || p.X > 1.0E-300 || p.Y < -1.0E-300 || p.Y > 1.0E-300)
            {
                preAtan = VariationHelper.PreAtan(p);
            }
            else
            {
                preAtan = 0.0;
            }

            // var y = P2;
            // var n2 = Math.PI * (P1*P1) + 1.0E-300;
            // var n3 = _n2 * 0.5;
            double n4;

            if (preAtan + P2 - (int)((preAtan + P2) / _n2) * _n2 > _n3)
            {
                n4 = preAtan - _n3;
            }
            else
            {
                n4 = preAtan + _n3;
            }
            return(new Point(W * sqrt * Math.Sin(n4), W * sqrt * Math.Cos(n4)));
        }