Exemple #1
0
        public float Me_to_po_length(PO p0)
        {
            //返回该点到p0的距离
            util u1 = new util();
            PO   pt = u1.cal_vec(this, p0);

            pt.z = 0;
            return(pt.length());
        }
Exemple #2
0
        public PO GetUnitVector(PO p0, PO p1)
        {
            //给定指定两点p0,p1的单位向量
            PO    vec = cal_vec(p0, p1);
            float x1  = vec.length();

            vec.x = vec.x / x1;
            vec.y = vec.y / x1;
            vec.z = vec.z / x1;
            return(vec);
        }
Exemple #3
0
        public float d3_Cal_Angle(PO p1, PO p2, PO center)
        {
            PO vec1, vec2;

            vec1   = new PO();
            vec2   = new PO();
            vec1.x = p1.x - center.x;
            vec1.y = p1.y - center.y;
            vec1.z = p1.z - center.z;
            vec2.x = p2.x - center.x;
            vec2.y = p2.y - center.y;
            vec2.z = p2.z - center.z;
            return((float)System.Math.Acos(Dot(vec1, vec2) / (vec1.length() * vec2.length())));
        }