コード例 #1
0
        public override Point Fun(Point p)
        {
            //            var p2 = Math.PI * 2.0 / P2;
            //            var phi = VariationHelper.Phi(p);
            //            var t3 = phi - p2 * Math.Floor(phi / p2);
            //            var q = p2 / 2.0;
            //            var t4 = t3 > q ? t3 : t3 - p2;
            //            var r = VariationHelper.R(p);
            //            var k = (P3 * (1.0 / Math.Cos(t4) - 1.0) + P4) / Math.Pow(r, P1);
            //            return new Point(k * p.X, k * p.Y);
            //"power", "sides", "corners", "circle"

            var corners = P3;
            var circle  = P4;

            var pow       = Math.Pow(VariationHelper.PreSumSq(p), _power);
            var preAtanYx = VariationHelper.PreAtanYx(p);
            var n3        = preAtanYx - _n2 * Math.Floor(preAtanYx / _n2);

            if (n3 > _n2Half)
            {
                n3 -= _n2;
            }
            var n4 = (corners * (1.0 / (Math.Cos(n3) + 1.0E-300) - 1.0) + circle) / (pow + 1.0E-300);

            return(new Point(W * p.X * n4, W * p.Y * n4));
        }
コード例 #2
0
        public override Point Fun(Point p)
        {
            var precalcAtanYx = VariationHelper.PreAtanYx(p);
            var n2            = 0.5 * Math.Log(VariationHelper.PreSumSq(p));
            var n3            = VariationHelper.TwoPi / P3;
            // double n4 = r / power;
            // double n5 = i / power;
            var n6  = _n4 * precalcAtanYx + _n5 * n2 + n3 * Math.Floor(P3 * VariationHelper.Psi);
            var n7  = W * Math.Exp(_n4 * n2 - _n5 * precalcAtanYx);
            var sin = Math.Sin(n6);
            var x   = n7 * Math.Cos(n6);
            var y   = n7 * sin;

            return(new Point(x, y));
        }
コード例 #3
0
        public override Point Fun(Point p)
        {
            var precalcAtanYX = VariationHelper.PreAtanYx(p);
            var precalcSqrt   = VariationHelper.PreSqrt(p);

            if (Math.Abs(precalcSqrt) <= VariationHelper.SmallDouble)
            {
                return(p);
            }
            var n2 = W * (VariationHelper.Psi - _holes) * Math.Cos(_petals * precalcAtanYX) / precalcSqrt;
            var x  = n2 * p.X;
            var y  = n2 * p.Y;


            return(new Point(x, y));
        }
コード例 #4
0
        public override Point Fun(Point p)
        {
            var precalcAtanYx = VariationHelper.PreAtanYx(p);
            var n2            = 0.5 * Math.Log(VariationHelper.PreSumSq(p));
            var sin           = Math.Sin(P1);
            var n3            = 0.5 * (1.0 + Math.Cos(P1));
            var n4            = 0.5 * sin;
            var n5            = W * Math.Exp(n3 * n2 - n4 * precalcAtanYx);
            var n6            = n3 * precalcAtanYx + n4 * n2;
            var sin2          = Math.Sin(n6);
            var x             = n5 * Math.Cos(n6);
            var y             = n5 * sin2;


            return(new Point(x, y));
        }
コード例 #5
0
        public override Point Fun(Point p)
        {
            var n2 = 0.0;

            for (var i = 0; i < 7; ++i)
            {
                var n3 = VariationHelper.RandomNext(10) - 5;
                if (Math.Abs(n3) >= 3)
                {
                    n3 = 0;
                }
                n2 += n3;
            }

            var n4 = n2 * _fixPe;
            var x  = _denominator * Math.Log(VariationHelper.PreSumSq(p));
            var y  = W * (VariationHelper.PreAtanYx(p) + n4);

            return(new Point(x, y));
        }