Hi, right now, I am working on a filter, and I need to know how to get predicted max distance. This is the gradient code. error_margin is predicted distance away from center due to rasterization error. It comes close enough even though it does not end on zero.
A code to generate values that determines actual max distance
rep_find_max_dist_rect:
sw=$1
sh={$sw}
graph_data=0
repeat $sw-1
$sw,$sh
rep_mjw_rectangle2archimedeanspiral
sh-=1
if !$>
graph_data={iM#-1}
else
temp_data={iM#-1}
graph_data.=,
graph_data.=$temp_data
fi
rm
done
v + echo $graph_data v -
As you can see, as one of the image dimension approaches zero, the max distance gets bigger and bigger.
My task is to find a equation that’ll allow me to find the max distance based on image ratio. From what I see, for some reason, the result reminds me of a logarithmic curve.
Also a reference I found which I have no idea what to do with it:
Yes, that is what I’m thinking about. I really wanna know the arc length using exponential factor along exponential radial gradient, cropped spiral from atan+radial, angle, and the greatest length inside the cropped area.
I actually got something here. It’s not much.
The good news, spiral length is expected. The bad news. It doesn’t correspond with the spiral gradient on the left, and I would like to figure this out. To expand, I would like to know the value on the right side quadrant point of the left image.
Ok, I think I found the solution. I decided to find arc_length without using the mumbo jumbo on the above post. My solution was to use px,py, and then use the calc_spiral(a,b) macro to find the arc length. My test shows that scaling is consistent. Now all I need to do is to address some limitations.
Also, adding const to sl cause a error. Not sure why though.
const basically means the value of the variable that follows can be determined at compile-time (when compiling the math expression into bytecode).
This means that every term after the equal sign must be a const value itself.
It’s not the case in your expression, because arguments atan_ang and rad are not const values (their values are not the same for every point (x,y)).
If I replace the macro expression variables with a,b, then it still wouldn’t work.
That being said, I got around that, and new bug: Just remove the ## block in the fill block, and then the output is not what it suppose to look like. The spiral is no longer there. Put the ## again, and then it’ll work. Why? It can be solved by dividing next to it instead of doing this, but nonetheless I think it’s a bug.