示例#1
0
文件: CTrans.cs 项目: nanma80/MPUlt
        // l=r*(w)*r^(-1)
        public void LtoW_V(ref RPoint LP, out RPoint WP)
        {
            QPoint Q = new QPoint(LP, 0.0);

            Q.LMul(ref m_R);
            Q.RDiv(ref m_R);
            WP = Q.PT;
        }
示例#2
0
文件: CTrans.cs 项目: nanma80/MPUlt
        //
        // new(L) = par(this(L))
        protected void ApplyRt(ref RPoint tr, ref QPoint rt)
        {
            QPoint QT = new QPoint(m_T, 0);

            QT.LMul(ref rt);
            QT.RDiv(ref rt);
            m_T = QT.PT;
            m_T.Add(ref tr);
            m_R.LMul(ref rt);
        }
示例#3
0
文件: CTrans.cs 项目: nanma80/MPUlt
        //
        public static CTrans FromAxis(RPoint pt, RPoint vec, double an)
        {
            an *= Math.PI / 360.0;            // half in radians
            RPoint T = RPoint.Zero;
            RPoint C = pt;

            double lR = vec.Dist();
            double xc = Math.Cos(an), xs = Math.Sin(an);

            vec.Mul(xs / lR);
            QPoint R = new QPoint(vec, xc);

            R.Norm();
            // w=R^(-1)*(l-C)*R+C
            T.Add(ref C);
            QPoint QC = new QPoint(C, 0);

            QC.LMul(ref R);
            QC.RDiv(ref R);
            T.Sub(ref QC.PT);
            return(new CTrans(T, R));
        }