new plotter
This commit is contained in:
parent
9ad431ffd3
commit
93c5e2a093
@ -190,9 +190,9 @@ public class CalculatorGraph2dView extends View implements GraphView {
|
||||
return;
|
||||
}
|
||||
if (scroller.computeScrollOffset()) {
|
||||
final float ration = getRatio();
|
||||
x0 = scroller.getCurrX() * ration;
|
||||
y0 = scroller.getCurrY() * ration;
|
||||
final float ratio = getRatio();
|
||||
x0 = scroller.getCurrX() * ratio;
|
||||
y0 = scroller.getCurrY() * ratio;
|
||||
if (!scroller.isFinished()) {
|
||||
invalidate();
|
||||
}
|
||||
@ -201,15 +201,7 @@ public class CalculatorGraph2dView extends View implements GraphView {
|
||||
}
|
||||
|
||||
private float eval(Function f, float x) {
|
||||
float v = (float) f.eval(x);
|
||||
// Calculator.log("eval " + x + "; " + v);
|
||||
if (v < -10000f) {
|
||||
return -10000f;
|
||||
}
|
||||
if (v > 10000f) {
|
||||
return 10000f;
|
||||
}
|
||||
return v;
|
||||
return (float) f.eval(x);
|
||||
}
|
||||
|
||||
// distance from (x,y) to the line (x1,y1) to (x2,y2), squared, multiplied by 4
|
||||
|
@ -73,7 +73,7 @@ public class CalculatorPlotFragment extends AbstractCalculatorPlotFragment {
|
||||
}
|
||||
|
||||
graphView.init(FunctionViewDef.newInstance(Color.WHITE, Color.WHITE, Color.DKGRAY, getBgColor()));
|
||||
graphView.setXRange((float)plotBoundaries.getXMin(), (float)plotBoundaries.getXMax());
|
||||
//graphView.setXRange((float)plotBoundaries.getXMin(), (float)plotBoundaries.getXMax());
|
||||
graphView.setFunctionPlotDefs(arityFunctions);
|
||||
|
||||
graphContainer.addView((View) graphView);
|
||||
|
Loading…
Reference in New Issue
Block a user