//---------------------------------------------------------------- public void ReSynchronize(double xe, double ye, uint len) { // Assume x1,y1 are equal to the ones At the previous End point int x1 = m_coord_x.y(); int y1 = m_coord_y.y(); int sx1 = m_scale_x.y(); int sy1 = m_scale_y.y(); // Calculate transformed Coordinates At x2,y2 double xt = xe; double yt = ye; m_trans_dir.Transform(ref xt, ref yt); int x2 = Basics.Round(xt * subpixel_scale); int y2 = Basics.Round(yt * subpixel_scale); double delta = 1 / (double)subpixel_scale; double dx; double dy; // Calculate Scale by X At x2,y2 dx = xt + delta; dy = yt; m_trans_inv.Transform(ref dx, ref dy); dx -= xe; dy -= ye; int sx2 = (int)Basics.UnsignedRound(subpixel_scale / Math.Sqrt(dx * dx + dy * dy)) >> subpixel_shift; // Calculate Scale by Y At x2,y2 dx = xt; dy = yt + delta; m_trans_inv.Transform(ref dx, ref dy); dx -= xe; dy -= ye; int sy2 = (int)Basics.UnsignedRound(subpixel_scale / Math.Sqrt(dx * dx + dy * dy)) >> subpixel_shift; // Initialize the interpolators m_coord_x = new Dda2LineInterpolator(x1, x2, (int)len); m_coord_y = new Dda2LineInterpolator(y1, y2, (int)len); m_scale_x = new Dda2LineInterpolator(sx1, sx2, (int)len); m_scale_y = new Dda2LineInterpolator(sy1, sy2, (int)len); }
public int x2() { return(line_lr(m_interpolator.y())); }