From d8015e48c73a3914353c3a2f9e2b9a581c5c6810 Mon Sep 17 00:00:00 2001 From: serso Date: Thu, 4 Oct 2012 18:15:25 +0400 Subject: [PATCH] Plotter improvements --- .../solovyev/android/calculator/plot/PlotUtils.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/calculatorpp/src/main/java/org/solovyev/android/calculator/plot/PlotUtils.java b/calculatorpp/src/main/java/org/solovyev/android/calculator/plot/PlotUtils.java index 821a20a4..8d605725 100644 --- a/calculatorpp/src/main/java/org/solovyev/android/calculator/plot/PlotUtils.java +++ b/calculatorpp/src/main/java/org/solovyev/android/calculator/plot/PlotUtils.java @@ -65,7 +65,7 @@ public final class PlotUtils { while (x <= max) { - boolean needToCalculateRealY = realSeries.needToAdd(defaultStep, x); + boolean needToCalculateRealY = realSeries.needToAdd(step, x); if (needToCalculateRealY) { final Complex c = calculatorExpression(expression, variable, x); @@ -77,7 +77,7 @@ public final class PlotUtils { realSeries.add(x, y); } - boolean needToCalculateImagY = imagSeries != null && imagSeries.needToAdd(defaultStep, x); + boolean needToCalculateImagY = imagSeries != null && imagSeries.needToAdd(step, x); if (needToCalculateImagY) { y = prepareY(c.imaginaryPart()); if (y != null) { @@ -90,7 +90,7 @@ public final class PlotUtils { } } } else { - boolean needToCalculateImagY = imagSeries != null && imagSeries.needToAdd(defaultStep, x); + boolean needToCalculateImagY = imagSeries != null && imagSeries.needToAdd(step, x); if (needToCalculateImagY) { final Complex c = calculatorExpression(expression, variable, x); Double y = prepareY(c.imaginaryPart()); @@ -107,11 +107,7 @@ public final class PlotUtils { step = updateStep(real, step, defaultStep / 2); - if (real.isX2Defined()) { - x = real.getX2() + step; - } else { - x += step; - } + x += step; } return imagExists;