But you already have those pixels/points:
n = 100;
x0 = round( linspace(min(x),max(x),n) );
y0 = round( linspace(min(y),max(y),n) );
Please look at the picture, because i did my best
Perpendicular vector p:
Then use equation of a line from two points:
- line from x and x0
- line from x and x1We have to find x,y then distance:
Accept the answer please if i helped you