From: Walter Roberson <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to draw an arc between two points given centre and radius
Date: Tue, 30 Mar 2010 14:41:08 -0500
Organization: Canada Eat The Cookie Foundation
Lines: 30
Message-ID: <hotk4m$hl8$>
References: <hotir8$8a8$>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: 1269978070 18088 (30 Mar 2010 19:41:10 GMT)
NNTP-Posting-Date: Tue, 30 Mar 2010 19:41:10 +0000 (UTC)
User-Agent: Thunderbird (X11/20100317)
In-Reply-To: <hotir8$8a8$>
Xref: comp.soft-sys.matlab:621996

Chanpreet wrote:
> how to draw an arc between two points given centre and radius on matlab

If you are given the two points, and given the centre and radius, then you 
cannot always do that. The distance from the centre and each of the points 
define radii, and if those two radii are not equal or are not equal to the 
given radius, then you cannot draw a circular arc.

The circular arcs that pass through any two given points define a line. If the 
centre is not on that line, you cannot do what you ask. Only one coordinate of 
the centre would need to be given, and the radius would not be needed. If, 
alternately, the radius were given, then that would narrow it to one of 
exactly two points, and the only reason the centre would need to be given 
would be to distinguish which of the two points it was.

Did you have something different in mind, such as a non-circular arc? Perhaps 
a parabolic arc, and the centre is really the focus?


You can use arctan to find the sector angle to be drawn. Be sure to check in 
case you are crossing over the periodic boundary, as you probably want to draw 
the smaller of the two arcs. Then, knowing the angles involved, linspace() the 
angle range into an appropriate number of points, and then the points of the 
arc are

[radius * cos(theta_range) + x of centre, radius * sin(theta_range) + y of