I'm not sure to which area this question is related , but I will give it a go. I'm trying to calculate the Mandelbrot set. The big difference is that my output is a 3D model. The set's calculation is done precisely, but once I try to zoom to a x,y point (which is located on the 2D plane) it doesn't work as expected. The main concept here is by the extract next zooming point, I will be able to calculate my set's new border edges. When
xru,yru = top right point of the set
xld yld = buttom left button
direction = 1 = zoom in
constVal = the original size of the set : 2X2
constVal[0] = xru , yru (at beginning)
constVal[1] = xld, yld (at beginning)
the result is zooming to unknown point. I guess that something is wrong with the calculation. I tried to do the following thing :
int direction = 1;
double ratiox = foundPointOnHost.x / ((constVal[1][0] - constVal[0][0]));
double ratioy = foundPointOnHost.z / ((constVal[1][1] - constVal[0][1]));
double xrange = xru-xld;
double yrange = yru-yld;
xld += direction*0.01*ratiox*xrange;
xru -= direction*0.01*(1.-ratiox)*xrange;
yld += direction*0.01*(1.-ratioy)*yrange;
yru -= direction*0.01*ratioy*yrange;
EDIT : i reviewed some of the examples you gave me , but i still haven't found any suitable answer which fits best to my situation.