Example #1
0
        public static NI2dPoint divergingOvalptpt(NI2dPoint F, double n1, NI2dVector v, NI2dPoint G, double n2, double S)
        {
            NI2dPoint ovalpt = new NI2dPoint(0, 0);

            v.Normalize();
            NI2dVector v1    = new NI2dVector(F, G);
            double     C1    = n1 * S + (n2 * n2) * v1.DotProduct(v);
            double     C2    = S * S - (n2 * n2) * v1.DotProduct(v1);
            double     gamma = -1.0;
            double     sigma = 0.0;

            if (n1 > n2)
            {
                sigma = -1 * gamma;
            }
            else if (n1 < n2)
            {
                sigma = 1 * gamma;
            }

            double c1numerator   = C1 + sigma * Math.Sqrt(C2 * (n2 * n2 - n1 * n1) + C1 * C1);
            double c1denominator = n1 * n1 - n2 * n2;
            double c1            = c1numerator / c1denominator;

            ovalpt = F + c1 * v.ConverttoPoint();

            return(ovalpt);
        }
Example #2
0
        public static NI2dPoint planewaveOvalpt(NI2dPoint F, double n1, NI2dVector v, NI2dPoint Q, double n2, NI2dVector n, double S)
        {
            NI2dPoint  ovalpt        = new NI2dPoint(0, 0);
            NI2dVector v1            = new NI2dVector(Q, F);
            double     c1numerator   = S - n2 * (v1.DotProduct(n));
            double     c1denominator = n1 - n2 * (v.DotProduct(n));
            double     c1            = c1numerator / c1denominator;

            ovalpt = F + c1 * v.ConverttoPoint();

            return(ovalpt);
        }
Example #3
0
        public static NI2dPoint reflectingOvalptpt(NI2dPoint F, NI2dVector v, NI2dPoint G, double n, double S)
        {
            NI2dPoint ovalpt = new NI2dPoint(0, 0);

            v.Normalize();
            NI2dVector v1            = new NI2dVector(F, G);
            double     c1numerator   = (S / n) * (S / n) - v1.DotProduct(v1);
            double     c1denominator = 2 * ((S / n) + v1.DotProduct(v));
            double     c1            = c1numerator / c1denominator;

            ovalpt = F + c1 * v.ConverttoPoint();

            return(ovalpt);
        }