One fine morning while Renee was doing her trigonometry homework, she paused to wonder how our
robotics team might be able to use her new-found skills. Ok, she was distracted. She entered some
equations into her graphics calculator and our logo took shape. We wear the logos on our shirts and
display them on our robot and business cards. We asked various professionals
whether these equations could be used to animate our logo for our website. Jeff Tjiputra referred
us to Chris Willy who knows Matlab.
On Tuesday, December 20, 2011, we met Mr. Chris Willy at the J. F. Taylor, Inc. main office. He
has been using Matlab since 1992 and created an animated logo for us. He walked us through the
code and told us how Matlab was being used on aircraft simulators. He referred to Matlab as an
"engineer's friend." He also told us that most engineering majors at colleges use some form of
math software. He answered our questions completely and we are interested in learning more about
it. He also told us about a similar product called Octave. This does basically the same thing as
Matlab, except it can't create videos.
Here is the code that causes our logo to balloon, explode, reform, and swing. The logo first
balloons three times. On the third time, the logo explodes. It then reconstitutes at a ninety
degree angle from the original. The logo then swings down to the original position.
% SSi_6
clear all
clc
f = @(x) sqrt(4-x.^2);
j = @(x) sqrt(0.64-x.^2);
k = @(x) -j(x);
p = @(x) (-3*(x-1).^5)-8;
nd = 2000;
z = linspace(0,1,nd);
x = 2*cos(linspace(-pi,0,nd));
%x = linspace(-2,2,nd);
xh = x(1:ceil(length(x)/2));
x2 = [x(end:-1:1),xh];
f2 = [f(x(end:-1:1)),-f(xh)]+2;
% cartesian coordinates for SSi
xS1 = [x2,-fliplr(x2)];
fS1 = [f2,-fliplr(f2)];
xS2 = xS1-4;
fS2 = fS1-4;
xd = [x(end:-1:1),x]/2.5;
fd = real([j(x(end:-1:1)/2.5),k(x/2.5)])-2;
zi = z;
fi = p(zi);
% random vectors for SSi explosion
xS1r = randn(1,length(xS1));
fS1r = randn(1,length(xS1));
xS2r = randn(1,length(xS2));
fS2r = randn(1,length(xS1));
xdr = randn(1,length(xd));
fdr = randn(1,length(fd));
zir = randn(1,length(zi));
fir = randn(1,length(fi));
i = 6*ones(1,10);
i = [i,i,9:3:45,45:-3:9,i,9:3:69,69:-3:9,i,9:6:200];
% balloon SSi
for l = 1:length(i)
figure(1)
plot(xS1,fS1,'.b',xS2,fS2,'.r',xd,fd,'.y',zi,fi,'.g', 'MarkerSize', i(l))
axis([-13,7,-11,7]);
axis off
SiSFrame(l)=getframe;
end
m = length(i);
t = linspace(0,pi/2,75);
i = 10*sin(t); j = i(4:end);
% explode SSi
for l = 1:length(j)
xS1p = xS1+j(l)*xS1r;
fS1p = fS1+j(l)*fS1r;
xS2p = xS2+j(l)*xS2r;
fS2p = fS2+j(l)*fS2r;
xdp = xd+j(l)*xdr;
fdp = fd+j(l)*fdr;
zip = zi+j(l)*zir;
fip = fi+j(l)*fir;
figure(1)
plot(xS1p,fS1p,'.b',xS2p,fS2p,'.r',xdp,fdp,'.y',zip,fip,'.g')
axis([-13,7,-11,7]);
axis off
SiSFrame(l+m) = getframe;
end
% make SSi pivot back to upright
for l = 1:length(theta)
xS1p = rS1.*cos(tS1+theta(l))-2;
fS1p = rS1.*sin(tS1+theta(l))+2;
xS2p = rS2.*cos(tS2+theta(l))-2;
fS2p = rS2.*sin(tS2+theta(l))+2;
xdp = rd.*cos(td+theta(l))-2;
fdp = rd.*sin(td+theta(l))+2;
zip = ri.*cos(ti+theta(l))-2;
fip = ri.*sin(ti+theta(l))+2;
figure(1)
plot(xS1p,fS1p,'.b',xS2p,fS2p,'.r',xdp,fdp,'.y',zip,fip,'.g')
axis([-13,7,-11,7]);
axis off
SiSFrame(l+m+n+o) = getframe;
end
%movie(SiSFrame,1,30)
%movie2avi(SiSFrame,'SiSFrame.avi', 'compression', 'none', 'fps', 20)