int imgSize = 400; real hh = 0.4; // step size of integration int stepNum = 30; // take at most this many steps // BUG or at least a strangeness in the how a syntax error is reported: // [bug009.diderot:9.10] Error: syntax error; try inserting "vec4" // // The function is missing the return type; why suggest vec4? // // Because vec4 is a type and inserting it will fix the syntax error. // function align (vec2 vv, vec2 ref) = vv; strand HLIC (real sign, vec2 pos0) { vec2 lastdir = pos0; vec2 pos = pos0; vec2 step = [0.0,0.0]; output real out = 0.0; real sum = 0.0; int stepIdx = 0; vec2 dir = [0.0,0.0]; update { dir = align(pos, lastdir); pos += hh*dir; sum += |pos|; stepIdx += 1; lastdir = dir; if (stepIdx == stepNum) { stabilize; } } stabilize { out = sum; } } initially [ HLIC(lerp(-1, 1, 0, si, 1), [lerp(0.0, 81.0, -0.5, xi, imgSize-0.5), lerp(0.0, 81.0, -0.5, yi, imgSize-0.5)]) | si in 0..1, yi in 0..imgSize-1, xi in 0..imgSize-1];
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: 0, 81.0, -0.5, yi, imgSize-0.5)]) | si in 0..1, yi in 0..imgSize-1, xi in 0..imgSize-1];