From d1b47d4a951f79c42f55c3128055563f83fd09f7 Mon Sep 17 00:00:00 2001 From: Anthex Date: Sat, 27 Apr 2019 03:42:27 +0200 Subject: [PATCH] fix mapping from values to images, now works with steps/emitters that are out of bounds compared to the initial situation --- structure.py | 2 +- visuals.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/structure.py b/structure.py index 3213396..ce798a5 100644 --- a/structure.py +++ b/structure.py @@ -299,5 +299,5 @@ def NLateration(data, step=.1, xSize=0.0, ySize=0.0, zSize=0.0): minDist = d minLoc = Location(round(k,2),round(l,2),round(m,2)) d = (max(1-d/10.0, 0))**2 - imageArray[floor(m*revStep)].append((265-floor(360-d*360), 255, floor(50+d*200))) + imageArray[floor(m*revStep)].append((265-floor(d*360), 255, floor(50+d*200))) return (minLoc, minDist, imageArray[0], floor(xSize*revStep), floor(ySize*revStep), imageArray) diff --git a/visuals.py b/visuals.py index b6b6d22..98e6524 100644 --- a/visuals.py +++ b/visuals.py @@ -2,7 +2,7 @@ from structure import NLateration, Location from math import floor, sqrt from PIL import Image, ImageDraw -global_step=.05 +global_step=.1 dataset = [(Location(.5,.5,.5), 3.0), (Location(4.0,.0,.0), 2.0), (Location(4.0,5.0,5.0), 4.2)] NLat_result = NLateration(dataset, step=global_step) W,H = NLat_result[3], NLat_result[4] -- libgit2 0.21.4