I am trying to find best coordinates and angle of inclination of line that would give me the least sum of distance between stationary curve and a line.
The curve position remains fixed but the coordinates of line can change and lines inclination can change giving me the best position of line that will give me the least sum of distance (objective function)
Can anyone suggest or hint how to use inbuilt optimization function provided in matlab to approach this problem. This is a multi variable optimization problem where we need to find best value of x,y, theta.
Diagram and constraints are given below to understand problem. The concept will help me in my research work. I have written the code as well to provide initial position of line and curve and inclination of line but I donot understand how to use inbuilt function here directly since variables of objective funtion are dependent on other variables.
Example that shows initial position and next iteration
Constraints and problem defination
code for position staionary curve and initial position of line
r = 40;
R = 55;
aa = 60*pi/180;
ap = 0*pi/180;
t1 = linspace(0,aa)-aa/2+ap;
[x1,y1] = pol2cart(t1,r);
L = linspace(0,10);
theta = 60*pi/180;
x=x0+ L* cos(theta);
y=y0+L * sin(theta);
ind= [25 75];