필터 지우기
필터 지우기

Coloring a line of intersection line of circles

조회 수: 6 (최근 30일)
Cladio Andrea
Cladio Andrea 2014년 12월 3일
댓글: Thorsten 2014년 12월 3일
Hello, i have found the intersection points of two circles , but i need to have such a code that let me color the line between two intersection points. Here i have attached the graph, you can see the intersection points colored in pink. Hope you can help.
<<
>>

답변 (3개)

Thorsten
Thorsten 2014년 12월 3일
line([x1 x2], [y1 y2], 'Color', 'r')

Image Analyst
Image Analyst 2014년 12월 3일
You can create an arc between the two points if you know the radius of the circle you want to follow. Just adapt the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F to get a list of (x,y) coordinates on the arc. Then use plot(x,y, '-', 'LineWidth', 3) to plot the arc.
  댓글 수: 1
Image Analyst
Image Analyst 2014년 12월 3일
Claudio, the code I referred you to will do that, you just now need to do it twice because you have two arcs that form an almond shape. There is no way you can do it without knowing the radius because there are lots of circles that could go through just a pair of points.

댓글을 달려면 로그인하십시오.


Cladio Andrea
Cladio Andrea 2014년 12월 3일
Thanks for the answers but i misexplained what i wanted to do in that scenario.
I am sorry for the picture but here i know the coordinates of the intersection points. what i want here is to color (just)the part of two circles(not inside) which is between intersection points.
  댓글 수: 1
Thorsten
Thorsten 2014년 12월 3일
Do you want to color all the marks in the lens-shaped intersection region in a particular color, such as magenta in your example? If so, how do you get all these different points, how are they defined?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by