Example #1
0
        //
        // 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);
        }
Example #2
0
        //
        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));
        }
Example #3
0
 // w=r*(l)*r^(-1)+t
 public void LtoW(ref RPoint LP, out RPoint WP)
 {
     this.LtoW_V(ref LP, out WP);
     WP.Add(ref m_T);
 }
Example #4
0
 // destructive ops
 public void Add(ref QPoint q)
 {
     PT.Add(ref q.PT);
     R += q.R;
 }