![How can I draw a line from center of multiple circles that will intersect all the circles - 2019 01 19.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/144934/How%20can%20I%20draw%20a%20line%20from%20center%20of%20multiple%20circles%20that%20will%20intersect%20all%20the%20circles%20-%202019%2001%2019.png)
How can I draw a line from center of multiple circles that will intersect all the circles?
1 view (last 30 days)
Show older comments
I want to multiple circles with same center but different radius. Later on I want add a line from center that will intersect all the cirles. I am attaching a figure to demonstrate how will be my expected output.
0 Comments
Accepted Answer
Star Strider
on 19 Jan 2019
Try this:
t = linspace(0, 2*pi);
r = [1, 2, 3];
xc = 0.5;
yc = 0.1;
xcir = (r(:)*cos(t))' + xc;
ycir = (r(:)*sin(t))' + yc;
figure
hold all
plot(xcir, ycir)
plot([xc, xc+5], [yc, yc], '-r')
hold off
axis equal
text(xc+r, yc*ones(1,numel(r)), ['$\frac{D}h$', compose('$\\frac{%dD}h$', r(2:end))], 'HorizontalAlignment','left', 'VerticalAlignment','top', 'Interpreter','latex', 'FontSize',12)
producing:
![How can I draw a line from center of multiple circles that will intersect all the circles - 2019 01 19.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/144934/How%20can%20I%20draw%20a%20line%20from%20center%20of%20multiple%20circles%20that%20will%20intersect%20all%20the%20circles%20-%202019%2001%2019.png)
Experiment to get the result you want.
7 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!