circcirc
Find intersection of circles in Cartesian coordinates
Description
Examples
Find Intersection of Two Circles
Find the intersection of two circles. The first circle has its center at (–2, 3) and a radius of 4. The second circle has its center at (1, –5) and a radius of 6.
[xout,yout] = circcirc(-2,3,4,1,-5,6)
xout = 1×2
1.4541 -3.2760
yout = 1×2
0.9828 -0.7910
Input Arguments
centerx1
— x-coordinate of center of first circle
numeric scalar
x-coordinate of the center of the first circle, specified as a numeric scalar.
centery1
— y-coordinate of center of first circle
numeric scalar
y-coordinate of the center of the first circle, specified as a numeric scalar.
radius1
— Radius of first circle
positive scalar
Radius of the first circle, specified as a positive scalar.
centerx2
— x-coordinate of center of second circle
numeric scalar
x-coordinate of the center of the second circle, specified as a numeric scalar.
centery2
— y-coordinate of center of second circle
numeric scalar
y-coordinate of the center of the second circle, specified as a numeric scalar.
radius2
— Radius of second circle
positive scalar
Radius of the second circle, specified as a positive scalar.
Output Arguments
xout
— x-coordinates of intersections
two-element vector
x-coordinates of the intersections, returned as a two-element vector.
When the circles are tangent, the elements of the vector are equal.
When the circles do not intersect or are identical, both elements are
NaN
.
yout
— y-coordinates of intersections
two-element vector
y-coordinates of the intersections, returned as a two-element vector.
When the circles are tangent, the elements of the vector are equal.
When the circles do not intersect or are identical, both elements are
NaN
.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)