Beispiel #1
0
        public override double Get(double x, double y, double z)
        {
            double dx  = x - XCenter.Get(x, y, z);
            double dy  = y - YCenter.Get(x, y, z);
            double dz  = z - ZCenter.Get(x, y, z);
            double len = Math.Sqrt(dx * dx + dy * dy + dz * dz);
            double rad = Radius.Get(x, y, z);
            double i   = (rad - len) / rad;

            if (i < 0)
            {
                i = 0;
            }

            if (i > 1)
            {
                i = 1;
            }

            return(i);
        }
Beispiel #2
0
        public override double Get(double x, double y, double z, double w, double u, double v)
        {
            double dx  = x - XCenter.Get(x, y, z, w, u, v);
            double dy  = y - YCenter.Get(x, y, z, w, u, v);
            double dz  = z - ZCenter.Get(x, y, z, w, u, v);
            double dw  = w - WCenter.Get(x, y, z, w, u, v);
            double du  = u - UCenter.Get(x, y, z, w, u, v);
            double dv  = v - VCenter.Get(x, y, z, w, u, v);
            double len = Math.Sqrt(dx * dx + dy * dy + dz * dz + dw * dw + du * du + dv * dv);
            double rad = Radius.Get(x, y, z, w, u, v);
            double i   = (rad - len) / rad;

            if (i < 0)
            {
                i = 0;
            }

            if (i > 1)
            {
                i = 1;
            }

            return(i);
        }