[xc,yc]=CircCalc(P1,P2,R)
[xc,yc]=CircCalc(P1,P2,R)
calculates a circle in P1,P2 and a given radius.
INPUT: P1 = [ x1 y1 ]
P2 = [ x2 y2 ]
R = value
RESULT: result is center point (yc,xc).
By: Marco Lehmann 21/oct /2014,
*****************************************
Example:
P1 = [1 1];
P2 = [3 6];
R = 10;
[xc,yc]=CircCalc(P1,P2,R)
figure
hold all
plot(P1(1),P1(2),'xg') % Point 1
plot(P2(1),P2(2),'xg') % Point 2
plot(xc(1),yc(1),'xr') % center point 1
plot(xc(2),yc(2),'xb') % center point 1
t=0:.01:2*pi;
plot(R*cos(t)+xc(1),R*sin(t)+yc(1),'r-') % calculated circle 1
plot(R*cos(t)+xc(2),R*sin(t)+yc(2),'b-') % calculated circle 2
hold off
axis equal
Cite As
Marco (2026). [xc,yc]=CircCalc(P1,P2,R) (https://www.mathworks.com/matlabcentral/fileexchange/48207-xc-yc-circcalc-p1-p2-r), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Signal Processing > Signal Processing Toolbox > Digital and Analog Filters > Digital Filter Analysis >
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
