MATLAB Answers

Drawing an arc between two elements?

9 views (last 30 days)
I want to draw an arc (given its centre and its radius) between two elements.
For example the case given in the image below. I would like to draw an arc (of radius 0.5 (as an example) and the centre de point P drawed) strictly between those two lines
What is the general case of doing it? I mean, in this particular case there are two lines, but I would like a method that would work for whatever elements between I'd want to draw an arc (between a circle and a line, between two circles...etc).


KSSV on 22 Oct 2020
You have not commented on your previous question...
If the answer worked for have to acknowledge the users who have helped you. With out closing that question, you are asking another question similiar ti it?

Sign in to comment.

Accepted Answer

KSSV on 22 Oct 2020
L1=[1 3;
1 6]
L2=[-2 2;
8 -1]
L = [L2(:,1) P L1(:,2)] ;
p = polyfit(L(1,:),L(2,:),2) ;
xi = linspace(min(L(1,:)),max(L(1,:))) ;
yi = polyval(p,xi) ;
hold on


Show 4 older comments
ErikJon Pérez Mardaras
ErikJon Pérez Mardaras on 23 Oct 2020
Thanks! I didn't realised. However, how do you stablish the centre of the arc? In the example given, the arc is drawn with a 0.5 radius, from 0º to 90º. But the centre is the 0.
How can I make the centre to be, for example, the coordinate 2,10? or the intersec point of two lines?
KSSV on 23 Oct 2020
xc = 2+0.5*cos(Th) ;
yc = 10+0.5*sin(th) ;

Sign in to comment.

More Answers (0)




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!