Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Draw an arc

81 views
Skip to first unread message

Carp Fisher

unread,
Feb 16, 2009, 8:45:55 PM2/16/09
to
How would I draw an arc in Matlab--I want to specify the center point, the radius, and the maybe the number of degrees of the arc? I specifically want a 180 degree arc. Thanks in advance, Kim

Carp Fisher

unread,
Feb 16, 2009, 8:46:55 PM2/16/09
to

Matt Fig

unread,
Feb 16, 2009, 9:13:02 PM2/16/09
to
I think you need 4 specifications to draw a circular arc. Here is one way to do it.

% arcang: The angle through which the arc passes.
% ang: The offset from 0 degrees till the arc starts.
% c: the [x,y] coords of circle's center.
% r: the radius of the circle.
c = [5 3];
r = 3;
ang = pi;
arcang = pi/2;
t = 0:.1:arcang;
x = r*cos(t+ang)+c(1);
y = r*sin(t+ang)+c(2);
plot(x,y)
xlim([c(1)-1.5*r c(1)+1.5*r])
ylim([c(2)-1.5*r c(2)+1.5*r])
axis equal


ggWOIMW-]UWKTVTMWP\IMAWK]5PI\XggJnVUaugIIXMQ\Q"(JgSIPI^ggWn

Husam Aldahiyat

unread,
Feb 16, 2009, 11:37:01 PM2/16/09
to
Carp Fisher <benbn...@hotmail.com> wrote in message <20279956.1234835246...@nitrogen.mathforum.org>...

> How would I draw an arc in Matlab--I want to specify the center point, the radius, and the maybe the number of degrees of the arc? I specifically want a 180 degree arc. Thanks in advance, Kim

There's a function that does this on the File Exchange.

Plot the angle arc for some angle.
http://www.mathworks.com/matlabcentral/fileexchange/21940

0 new messages