Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Elegent 2D arc plotting given 2 points and arc angle

Subject: Elegent 2D arc plotting given 2 points and arc angle

From: Richard Crozier

Date: 27 Feb, 2013 13:33:09

Message: 1 of 1

Hello,

Does anyone have an elegent method of plotting a 2D arc given two points at either end, and the angle swept out by the arc?

e.g.

p0 = [0,0];
p1 = [0,1];
theta= 2*pi;

line( [p0(1), p1(1)] , [p0(2), p1(2)] );
hold on;
plotarc(p0,p1,theta)
hold off;

would draw a semicricle, and

p0 = [0,0];
p1 = [0,1];
theta = pi;

line( [p0(1), p1(1)] , [p0(2), p1(2)] )
hold on
plotarc(p0,p1,angle)
hold off

would draw a segment of a circle the boundaries of which are a circular arc of a circle with central angle pi radians and the chord created by the line.

Hope this will pique someone's interest!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us