%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% //-- Program to calculate the length of the legs --\\                 %%    
%%                                                                       %%
%% // Designed by: Marco Eckert 21/07/2011                               %% 
%%                                                                       %%
%% // Version 1.23                                                       %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Calculation nonlinear-equation-system Direct_Leg_Calc:
                                   
x0 = [0, 1800, 600];

% options = optimset ('MaxFunEvals',2000,'MaxIter',2000);
% options = optimset('TolX', 1e-10); 

[x,fval] = fsolve(@(x)Direct_Leg_Calc(x, r_11, r_21, r_31, bc_1, bc_2, bc_3, ed_1, ed_2, ed_3, l_1, l_2, l_3) ,x0);

r_p = [x(1); x(2); x(3)];