Esempio n. 1
0
        public static CNCVector GetPerpendicularVector(CNCVector vt1, CNCVector vt2)
        {
            double a = vt1.b * vt2.c - vt1.c * vt2.b;
            double b = -(vt1.a * vt2.c - vt1.c * vt1.a);
            double c = vt1.a * vt2.b - vt1.b * vt2.a;

            return(new CNCVector(a, b, c));
        }
Esempio n. 2
0
        public CNCPlane(CNCPoint pt1, CNCPoint pt2, CNCPoint pt3)
        {
            CNCVector vt1 = new CNCVector(pt1, pt2);
            CNCVector vt2 = new CNCVector(pt1, pt3);

            CNCVector perpVt = CNCVector.GetPerpendicularVector(vt1, vt2);

            this.a = perpVt.a;
            this.b = perpVt.b;
            this.c = perpVt.c;

            this.d = pt1.x * a + pt1.y * b + pt1.z * c;
        }