Algorithm to zoom a plotted function
- by astinx
I'm making a game in android and I need plot a function, my algorithm is this:
@Override
protected void onDraw(Canvas canvas) {
float e = 0.5f;
//from -x axis to +x evaluate f(x)
for (float x = -z(canvas.getWidth()); x < z(canvas.getWidth()); x+=e) {
float x1,y1;
x1 = x;
…