Functions | Variables

lin2spline.m File Reference

Functions

vykresleni primek figure (3)
 plot (edges(1,:), edges(2,:), 'r')
grid title ('lin2spline')
 xlabel ('x')
 ylabel ('y')
 if (absVect0 > absVect1) vect0
 if (vect0(2)< 0) angle0
vypocet polynomu (to uz dela plotspline, ale ja nevim, jak to z toho dostat po dobehu fminsearch) p
 cos (angle1/180 *pi) sin(angle1/180 *pi)
for plot (polyval(px, t), polyval(py, t), '.b')
end figure (4) title('Curvature')
 xlabel ('t')
 plot (t, kappa, '+m')

Variables

complete trajectory algorithm
aproximace rohu splinem 
radu
complete trajectory algorithm
aproximace rohu splinem spline
zacina v pulce kratsiho ze
dvou navazujicich useku clear 
all
 clc
zadani libovolneho poctu bodu edges = [0 5 1 1 6 0 6
hold on aproximace rohu for i
 vect1 = edges(:, i+1) - edges(:, i)
polovina useku vect0 = vect0 / 2
 absVect0 = sqrt(vect0(1)^2 + vect0(2)^2)
 absVect1 = sqrt(vect1(1)^2 + vect1(2)^2)
 distance = absVect1
end pocatecni a koncovy bod X0 = edges(:, i) + vect0
 X1 = edges(:, i) + vect1
uhly segmentu angle0 = acos((vect0(1)) /(distance)) /pi * 180
end angle1 = acos((vect1(1)) /(distance)) /pi * 180
end optimalizace i s absolutni
vzdalenosti 
m = fminsearch(@(m)plotspline(angle0,angle1,distance,m), 1)
NYNI VYCHYTAVKA APROXIMACE
POMOCI ELIPSY 
A = 6860
 B = 4.4
 alpha = abs(angle0 - angle1)
 x0 = X0(1)
 y0 = X0(2)
 x1 = X1(1)
 y1 = X1(2)
 xx0 = m*(p(2,1) - p(1,1))
 yy0 = m*(p(2,2) - p(1,2))
 xx1 = m*(p(3,1) - p(2,1))
 yy1 = m*(p(3,2) - p(2,2))
 px
 py
for t = 0:0.01:1
grid on hold on for kappa = ((5*(-3*xx1-3*xx0-6*x0+6*x1)*t^4+4*(7*xx1+8*xx0+15*x0-15*x1)*t^3+3*(-4*xx1-6*xx0-10*x0+10*x1)*t^2+xx0)*(20*(-3*yy1-3*yy0-6*y0+6*y1)*t^3+12*(7*yy1+8*yy0+15*y0-15*y1)*t^2+6*(-4*yy1-6*yy0-10*y0+10*y1)*t)-(5*(-3*yy1-3*yy0-6*y0+6*y1)*t^4+4*(7*yy1+8*yy0+15*y0-15*y1)*t^3+3*(-4*yy1-6*yy0-10*y0+10*y1)*t^2+yy0)*(20*(-3*xx1-3*xx0-6*x0+6*x1)*t^3+12*(7*xx1+8*xx0+15*x0-15*x1)*t^2+6*(-4*xx1-6*xx0-10*x0+10*x1)*t))/((5*(-3*xx1-3*xx0-6*x0+6*x1)*t^4+4*(7*xx1+8*xx0+15*x0-15*x1)*t^3+3*(-4*xx1-6*xx0-10*x0+10*x1)*t^2+xx0)^2+(5*(-3*yy1-3*yy0-6*y0+6*y1)*t^4+4*(7*yy1+8*yy0+15*y0-15*y1)*t^3+3*(-4*yy1-6*yy0-10*y0+10*y1)*t^2+yy0)^2)^(3/2)

Function Documentation

cos ( angle1/180 *  pi  ) 
vykresleni aproximacniho splinu figure (  ) 
end figure (  ) 
if ( absVect0  ,
absVect1   
)
if (  ) 
plot ( edges(1,:)  ,
edges(2,:)  ,
'r  
)
for plot ( polyval(px, t ,
polyval(py, t ,
'.b  
)
plot ( t  ,
kappa  ,
'+m'   
)
vypocet polynomu ( to uz dela  plotspline,
ale ja  nevim,
jak to z toho dostat po dobehu  fminsearch 
)
grid title ( 'lin2spline'   ) 
xlabel ( 'x  ) 
xlabel ( 't  ) 
ylabel ( 'y'   ) 

Variable Documentation

NYNI VYCHYTAVKA APROXIMACE POMOCI ELIPSY A = 6860
absVect0 = sqrt(vect0(1)^2 + vect0(2)^2)
absVect1 = sqrt(vect1(1)^2 + vect1(2)^2)
close all
alpha = abs(angle0 - angle1)
uhly segmentu angle0 = acos((vect0(1)) /(distance)) /pi * 180
end angle1 = acos((vect1(1)) /(distance)) /pi * 180
B = 4.4
clc
distance = absVect1
zadani libovolneho poctu bodu edges = [0 5 1 1 6 0 6
hold on aproximace rohu for i
Initial value:
2:length(edges)-1
    vect0 = edges(:, i-1) - edges(:, i)
grid on hold on for kappa = ((5*(-3*xx1-3*xx0-6*x0+6*x1)*t^4+4*(7*xx1+8*xx0+15*x0-15*x1)*t^3+3*(-4*xx1-6*xx0-10*x0+10*x1)*t^2+xx0)*(20*(-3*yy1-3*yy0-6*y0+6*y1)*t^3+12*(7*yy1+8*yy0+15*y0-15*y1)*t^2+6*(-4*yy1-6*yy0-10*y0+10*y1)*t)-(5*(-3*yy1-3*yy0-6*y0+6*y1)*t^4+4*(7*yy1+8*yy0+15*y0-15*y1)*t^3+3*(-4*yy1-6*yy0-10*y0+10*y1)*t^2+yy0)*(20*(-3*xx1-3*xx0-6*x0+6*x1)*t^3+12*(7*xx1+8*xx0+15*x0-15*x1)*t^2+6*(-4*xx1-6*xx0-10*x0+10*x1)*t))/((5*(-3*xx1-3*xx0-6*x0+6*x1)*t^4+4*(7*xx1+8*xx0+15*x0-15*x1)*t^3+3*(-4*xx1-6*xx0-10*x0+10*x1)*t^2+xx0)^2+(5*(-3*yy1-3*yy0-6*y0+6*y1)*t^4+4*(7*yy1+8*yy0+15*y0-15*y1)*t^3+3*(-4*yy1-6*yy0-10*y0+10*y1)*t^2+yy0)^2)^(3/2)
m = fminsearch(@(m)plotspline(angle0,angle1,distance,m), 1)
px
Initial value:
 [ 
       -3*xx1-3*xx0-6*x0+6*x1
      7*xx1+8*xx0+15*x0-15*x1
     -4*xx1-6*xx0-10*x0+10*x1
                            0
                          xx0
                           x0]
py
Initial value:
 [
       -3*yy1-3*yy0-6*y0+6*y1
      7*yy1+8*yy0+15*y0-15*y1
     -4*yy1-6*yy0-10*y0+10*y1
                            0
                          yy0
                           y0]
complete trajectory algorithm aproximace rohu splinem radu
grid on hold on for t = 0:0.01:1
polovina useku vect0 = vect0 / 2
else vect1 = edges(:, i+1) - edges(:, i)
end pocatecni a koncovy bod X0 = edges(:, i) + vect0
x0 = X0(1)
x1 = X1(1)
X1 = edges(:, i) + vect1
xx0 = m*(p(2,1) - p(1,1))
xx1 = m*(p(3,1) - p(2,1))
y0 = X0(2)
y1 = X1(2)
yy0 = m*(p(2,2) - p(1,2))
yy1 = m*(p(3,2) - p(2,2))