rubberstretch.py revision 9e9083d5b1ba585665bf2f97eb2fba6a6e4d11eb
'''
Copyright (C) 2006 Jean-Francois Barraud, barraud@math.univ-lille1.fr
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
barraud@math.univ-lille1.fr
'''
for v in vects:
v[1]*=-1
for v in vects:
#--spherify
# s=((x*x+y*y)/(w*w+h*h))**(-a/2)
# bpt[0]=x0+s*x
# bpt[1]=y0+s*y
# for v in vects:
# dx,dy=v
# v[0]=(1-a/2/(x*x+y*y)*2*x*x)*s*dx+( -a/2/(x*x+y*y)*2*y*x)*s*dy
# v[1]=( -a/2/(x*x+y*y)*2*x*y)*s*dx+(1-a/2/(x*x+y*y)*2*y*y)*s*dy
for v in vects:
v[1]*=-1
e = RubberStretch()
e.affect()