From 97039067dacef98b10f985770468a8eb4dd97aa9 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 29 May 2014 09:27:38 +0200 Subject: Replace some 'sqrt(a*a, b*b)' by 'hypot(a, b)'. Patch by ldo (Lawrence D'Oliveiro), with very minor changes by myself. --- add_mesh_ant_landscape.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'add_mesh_ant_landscape.py') diff --git a/add_mesh_ant_landscape.py b/add_mesh_ant_landscape.py index b99eb2be..e83b6134 100644 --- a/add_mesh_ant_landscape.py +++ b/add_mesh_ant_landscape.py @@ -332,7 +332,7 @@ def landscape_gen(x,y,z,falloffsize,options=[0,1.0,1, 0,0,1.0,0,6,1.0,2.0,1.0,2. # edge falloff if sphere == 0: # no edge falloff if spherical if falloff != 0: - fallofftypes = [ 0, sqrt((x*x)**2+(y*y)**2), sqrt(x*x+y*y), sqrt(y*y), sqrt(x*x) ] + fallofftypes = [0, hypot(x * x, y * y), hypot(x, y), abs(y), abs(x)] dist = fallofftypes[ falloff] if falloff ==1: radius = (falloffsize/2)**2 -- cgit v1.2.3