//Your implicit function with x[0], x[1], and x[2] variables. //The bounding box is [-20, 20]^3 //Please write with C form. //The code will be included to function "EvaluateFunction" //in class "OurImplicitFunction". //If you want to add a new function, //please edit class "OurImplicitFunction", sorry. /*********** Example ****************/ float x1 = x[0]; float y1 = x[1]; float z1 = x[2]; float tar = (y1+15.0f)/15.0f; x1 /= tar*tar; z1 /= tar*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(3 - fabs(xt), 15 - fabs(yt)), 1 - fabs(zt)); float rect3 = 4 - xt*xt - (yt-5)*(yt-5)/4; x1 = x[0]; y1 = x[1]; z1 = x[2]; tar = (y1+14)/10; x1 /= tar*tar; z1 /= tar*tar; float sphere = 5 - x1*x1 - (y1+10)*(y1+10) - z1*z1; float f1 = R_int(rect, -rect3); float f2 = sphere; return R_uni(f1, f2) + 100/(1+(f1/2)*(f1/2)+(f2/2)*(f2/2));