// 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)); }
public void Mul(double v) { PT.Mul(v); R *= v; }