Exemple #1
0
        public quaternion[] GetThreePoints(double k = 100.0)
        {
            quaternion[] rez = new quaternion[3];

            quaternion xOrt = new quaternion(0, 1, 0, 0);
            quaternion yOrt = new quaternion(0, 0, 1, 0);

            quaternion r1 = n / xOrt;
            quaternion r2 = n / yOrt;

            quaternion r3 = (r1.absV() > r2.absV()) ? r1 : r2;

            r3 = new quaternion(0, r3.GetX(), r3.GetY(), r3.GetZ());

            UCS ucs = new UCS(new quaternion(), n, r3);

            rez[0] = new quaternion();
            rez[1] = ucs.ToACS(new quaternion(0, 0, 0, k));
            rez[2] = ucs.ToACS(new quaternion(0, 0, k, 0));

            return(rez);
        }
Exemple #2
0
        //p1 - start na otse4kata, p2 - end of segment
        // nout internal - return null
        public static quaternion IsInternalForSegment(quaternion p1, quaternion p2, quaternion p)
        {
            quaternion rez = (p - p1) / (p2 - p1);

            return((rez.absV() < Constants.zero_dist && rez.real() > Constants.zero_dist && rez.real() < (1.0 - Constants.zero_dist)) ? rez : null);
        }
Exemple #3
0
        //3 points and line
        //p1,p2 define line
        // nout coincident - return null
        public static quaternion IsCoincidentWithLine(quaternion p1, quaternion p2, quaternion p)
        {
            quaternion rez = (p - p1) / (p2 - p1);

            return((rez.absV() < Constants.zero_dist) ? rez: null);
        }
Exemple #4
0
        //p1 - start na otse4kata, p2 - end of segment
        // nout internal - return null
        public quaternion IsInternalForSegment(quaternion lP1, quaternion lP2)
        {
            quaternion rez = (new quaternion(q[0], q[1], q[2], q[3]) - lP1) / (lP2 - lP1);

            return((rez.absV() < Constants.zero_dist && rez.real() > Constants.zero_dist && rez.real() < (1.0 - Constants.zero_dist)) ? rez : null);
        }
Exemple #5
0
        //3 points and line
        //p1,p2 define line
        // nout coincident - return null
        public quaternion IsCoincidentWithLine(quaternion lP1, quaternion lP2)
        {
            quaternion rez = (new quaternion(q[0], q[1], q[2], q[3]) - lP1) / (lP2 - lP1);

            return((rez.absV() < Constants.zero_dist) ? rez : null);
        }