Exemplo n.º 1
0
        public Location3D[] Intersections(LinearParamater3D lp)
        {
            double            a  = Math.Pow(lp.A.X, 2) + Math.Pow(lp.A.Y, 2) + Math.Pow(lp.A.Z, 2);
            double            b  = -2 * (A * lp.A.X + B * lp.A.Y + C * lp.A.Z - lp.B.X * lp.A.X - lp.B.Y * lp.A.Y - lp.B.Z * lp.A.Z);
            double            c  = -Math.Pow(R, 2) + Math.Pow(A, 2) - 2 * A * lp.B.X + Math.Pow(B, 2) - 2 * B * lp.B.Y + Math.Pow(C, 2) - 2 * C * lp.B.Z + Math.Pow(lp.B.X, 2) + Math.Pow(lp.B.Y, 2) + Math.Pow(lp.B.Z, 2);
            QuadraticFunction qf = new QuadraticFunction(a, b, c);

            return(qf.Roots().Select(d => lp.Point(d)).ToArray());
        }
Exemplo n.º 2
0
 public bool Intersect(LinearParamater3D lp)
 {
     return((lp.B - B) * A.CrossProduct(lp.B) == 0);
 }