From: Jeff E. <gi...@gi...> - 2010-03-23 21:09:22
|
calculate tx, ty without requiring rad http://git.linuxcnc.org/?p=emc2.git;a=commitdiff;h=d5ee3ab --- src/emc/rs274ngc/gcodemodule.cc | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/emc/rs274ngc/gcodemodule.cc b/src/emc/rs274ngc/gcodemodule.cc index ba6b888..20aa2d0 100644 --- a/src/emc/rs274ngc/gcodemodule.cc +++ b/src/emc/rs274ngc/gcodemodule.cc @@ -878,7 +878,6 @@ static PyObject *rs274_arc_to_segments(PyObject *self, PyObject *args) { rotation_cos = cos(rotation_xy); unrotate(o[0], o[1], rotation_cos, rotation_sin); - double rad = hypot(o[X]-cx, o[Y]-cy); double theta1 = atan2(o[Y]-cy, o[X]-cx); double theta2 = atan2(n[Y]-cy, n[X]-cx); @@ -896,7 +895,7 @@ static PyObject *rs274_arc_to_segments(PyObject *self, PyObject *args) { double d[9] = {0, 0, 0, n[4]-o[4], n[5]-o[5], n[6]-o[6], n[7]-o[7], n[8]-o[8]}; d[Z] = o[Z] - n[Z]; - double tx = cos(theta1) * rad, ty = sin(theta1)*rad, dc = cos(dtheta*rsteps), ds = sin(dtheta*rsteps); + double tx = o[X] - cx, ty = o[Y] - cy, dc = cos(dtheta*rsteps), ds = sin(dtheta*rsteps); for(int i=0; i<steps-1; i++) { double f = i * rsteps; double p[9]; |