I need to solve a min distance problem, to see some of the work which has being tried take a look at:
link: click here
I have four elements: two column vectors: alpha
of dim (px1)
and beta
of dim (qx1)
. In this case p = q = 50
giving two column vectors of dim (50x1)
each. They are defined as follows:
alpha = alpha = 0:0.05:2;
beta = beta = 0:0.05:2;
and I have two matrices: L1
and L2
.
L1
is composed of three column-vectors of dimension (kx1)
each.
L2
is composed of three column-vectors of dimension (mx1)
each.
In this case, they have equal size, meaning that k = m = 1000
giving: L1
and L2
of dim (1000x3)
each. The values of these matrices are predefined.
They have, nevertheless, the following structure:
L1(kx3) = [t1(kx1) t2(kx1) t3(kx1)];
L2(mx3) = [t1(mx1) t2(mx1) t3(mx1)];
The min. distance problem I need to solve is given (mathematically) as follows:
d = min( (x-(alpha_p*t1_k - beta_q*t1_m)).^2 + (y-(alpha_p*t2_k - beta_q*t2_m)).^2 +
(z-(alpha_p*t3_k - beta_q*t3_m)).^2 )
the values x,y,z
are three fixed constants.
My problem
I need to develop an iteration which can give me back the index positions from the combination of: alpha, beta, L1
and L2
which fulfills the min-distance problem from above.
I hope the formulation for the problem is clear, I have been very careful with the index notations. But if it is still not so clear... the step size for:
alpha
is p = 1,...50
beta
is q = 1,...50
for L1
; t1, t2, t3
is k = 1,...,1000
for L2
; t1, t2, t3
is m = 1,...,1000
And I need to find the index of p
, index of q
, index of k
and index of m
which gives me the min. distance to the point x,y,z
.
Thanks in advance for your help!