summaryrefslogtreecommitdiff
path: root/wing_scripts/get_ds.m
blob: 2f0eb9d5e588faa95368f4baca3a6e54bb627046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function ds = get_ds(xi,xf,u)

dist = 0;
numSteps = 10;
dx = (xf-xi)/numSteps;
z0 = get_z(xi,u);
x0 = xi;
for i=1:10
    tempX = x0+dx;
    if tempX > 0
        tempZ = get_z(tempX,u);
    else 
        tempZ = 0;
    end
    dist = dist + (dx^2+(tempZ-z0)^2)^.5;
    z0 = tempZ;
    x0 = tempX;
end

ds =dist;
Copyright 2019--2024 Marius PETER