[PyX-checkins] pyx/pyx helper.py,1.19,1.20 connector.py,1.32,1.33

 [PyX-checkins] pyx/pyx helper.py,1.19,1.20 connector.py,1.32,1.33 From: Michael Schindler - 2005-09-27 08:37:05 ```Update of /cvsroot/pyx/pyx/pyx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32422 Modified Files: helper.py connector.py Log Message: move sign function into helper Index: connector.py =================================================================== RCS file: /cvsroot/pyx/pyx/pyx/connector.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** connector.py 15 Sep 2005 16:12:32 -0000 1.32 --- connector.py 27 Sep 2005 08:36:57 -0000 1.33 *************** *** 31,35 **** def radians(x): return x*pi/180 def degrees(x): return x*180/pi - from deformer import sign1 --- 31,34 ---- *************** *** 138,142 **** else: radius = abs(0.5 * (bulge + 0.25 * distance**2 / bulge)) ! centerdist = sign1(bulge) * (radius - abs(bulge)) center = (0.5 * (self.box1.center[0] + self.box2.center[0]) - tangent[1]*centerdist, 0.5 * (self.box1.center[1] + self.box2.center[1]) + tangent[0]*centerdist) --- 137,141 ---- else: radius = abs(0.5 * (bulge + 0.25 * distance**2 / bulge)) ! centerdist = helper.sign(bulge) * (radius - abs(bulge)) center = (0.5 * (self.box1.center[0] + self.box2.center[0]) - tangent[1]*centerdist, 0.5 * (self.box1.center[1] + self.box2.center[1]) + tangent[0]*centerdist) Index: helper.py =================================================================== RCS file: /cvsroot/pyx/pyx/pyx/helper.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** helper.py 14 Sep 2005 13:33:23 -0000 1.19 --- helper.py 27 Sep 2005 08:36:57 -0000 1.20 *************** *** 4,8 **** # # Copyright (C) 2002-2004 Jörg Lehmann ! # Copyright (C) 2002-2004 André Wobst # # This file is part of PyX (http://pyx.sourceforge.net/). --- 4,9 ---- # # Copyright (C) 2002-2004 Jörg Lehmann ! # Copyright (C) 2002-2005 André Wobst ! # Copyright (C) 2005 Michael Schindler # # This file is part of PyX (http://pyx.sourceforge.net/). *************** *** 23,26 **** --- 24,30 ---- + def sign(x): + return (x >= 0) and 1 or -1 + # XXX fallback for Numeric (eigenvalue computation) to be implemented along # know algorithms (like from numerical recipes) ```

 [PyX-checkins] pyx/pyx helper.py,1.19,1.20 connector.py,1.32,1.33 From: Michael Schindler - 2005-09-27 08:37:05 ```Update of /cvsroot/pyx/pyx/pyx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32422 Modified Files: helper.py connector.py Log Message: move sign function into helper Index: connector.py =================================================================== RCS file: /cvsroot/pyx/pyx/pyx/connector.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** connector.py 15 Sep 2005 16:12:32 -0000 1.32 --- connector.py 27 Sep 2005 08:36:57 -0000 1.33 *************** *** 31,35 **** def radians(x): return x*pi/180 def degrees(x): return x*180/pi - from deformer import sign1 --- 31,34 ---- *************** *** 138,142 **** else: radius = abs(0.5 * (bulge + 0.25 * distance**2 / bulge)) ! centerdist = sign1(bulge) * (radius - abs(bulge)) center = (0.5 * (self.box1.center[0] + self.box2.center[0]) - tangent[1]*centerdist, 0.5 * (self.box1.center[1] + self.box2.center[1]) + tangent[0]*centerdist) --- 137,141 ---- else: radius = abs(0.5 * (bulge + 0.25 * distance**2 / bulge)) ! centerdist = helper.sign(bulge) * (radius - abs(bulge)) center = (0.5 * (self.box1.center[0] + self.box2.center[0]) - tangent[1]*centerdist, 0.5 * (self.box1.center[1] + self.box2.center[1]) + tangent[0]*centerdist) Index: helper.py =================================================================== RCS file: /cvsroot/pyx/pyx/pyx/helper.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** helper.py 14 Sep 2005 13:33:23 -0000 1.19 --- helper.py 27 Sep 2005 08:36:57 -0000 1.20 *************** *** 4,8 **** # # Copyright (C) 2002-2004 Jörg Lehmann ! # Copyright (C) 2002-2004 André Wobst # # This file is part of PyX (http://pyx.sourceforge.net/). --- 4,9 ---- # # Copyright (C) 2002-2004 Jörg Lehmann ! # Copyright (C) 2002-2005 André Wobst ! # Copyright (C) 2005 Michael Schindler # # This file is part of PyX (http://pyx.sourceforge.net/). *************** *** 23,26 **** --- 24,30 ---- + def sign(x): + return (x >= 0) and 1 or -1 + # XXX fallback for Numeric (eigenvalue computation) to be implemented along # know algorithms (like from numerical recipes) ```