Path: news.mathworks.com!not-for-mail
From: "Cory Lauer" <cjlauer90@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Need help with robotic arm function
Date: Sun, 3 Feb 2013 22:44:08 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 27
Message-ID: <kemp7o$ijd$1@newscl01ah.mathworks.com>
Reply-To: "Cory Lauer" <cjlauer90@gmail.com>
NNTP-Posting-Host: www-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1359931448 19053 172.30.248.37 (3 Feb 2013 22:44:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 3 Feb 2013 22:44:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 4039472
Xref: news.mathworks.com comp.soft-sys.matlab:788132

function [] = armSim(theta1, theta2, a1, a2)

a0 = 5.64;
Y1 = a0;
Y2 = (a0 + (a1 * sind(theta1)));
Y3 = (Y2 + (a2 * sind(theta2)));
X1 = 0;
X2 = (0 + (a1 * cosd(theta1)));
X3 = (X2 + (a2 * cosd(theta2)));
line([-4 0], [0 0]);
hold on;
line([0 0], [0 a0]);
t = 0:0.1:2*pi;
x = cos(t)/15;
y = (sin(t)/15) + a0;
plot(x,y);
plotline(0,a0,a1,theta1,'b-');
x = (cos(t)/15) + (0 + (a1 * cosd(theta1)));
y = (sin(t)/15) + (a0 + (a1 * sind(theta1)));
plot(x,y);
plotline(X2,Y2,a2,theta2,'b-');
x = (cos(t)/15) + X3;
y = (sin(t)/15) + Y3;
plot(x,y);
hold off;

This code takes 2 values of theta and 2 values of length to produce a simulation of the position of a 2DOF robotic arm in a standard graph. I need to change the output so that 0 degrees is graphed along the positive y-axis, 90 along the positive x-axis, and -90 along the negative x-axis. Help?