clear variables
close all
%
%  Geometric Constants
%
d=15;            %distance from strut pivot to link attachement point, inches
r=18;           %length of the angled arm, inches
D=24;           %horizontal distance from pivot to top of angled arm, inches
lo=1;           %distance from centerline of struct to the link pin, inches
%
%  For the wheel-- we don't need to change these much
%
w=36;           %distance to wheel, inches
dw=12;          %wheel diameter, inches
tw=3;           %wheel thickness, inches
ow=1;           %wheel offset, inches
%
%  Find the length of the link itself
%
l=sqrt(d*d+(D-lo)*(D-lo))-r;
%
%  Solve for the various geometries and make pictures
%
tdstart=270*pi/180;
tddelta=-10*pi/180;
tdend=190*pi/180;
for td=tdstart:tddelta:tdend
    tol=0.01;
    [e]=fitgeom(d,l,r,lo,D,td,tol);
    [y,index]=min(e);
    [minval,j]=min(y);
    col=j;
    row=index(j);
    tl=(row-1)*tol;
    tr=(col-1)*tol;
    geometrypic(d,r,D,lo,td,w,dw,tw,ow,l,tl,tr);
end
