float x1 = x[0]; float y1 = x[1]; float z1 = x[2]; float tar = 0.002*y1*y1 + 0.5; x1 /= tar; z1 /= tar; double angle = 4*PI*y1/30.0f; float xt = x1*cos(angle) + z1*sin(angle); float yt = y1; float zt = -x1*sin(angle) + z1*cos(angle); float rect = R_int(R_int(2 - fabs(xt-5), 19 - fabs(yt)), 6 - fabs(zt)); return rect;