How to recenter a circle?

조회 수: 13 (최근 30일)
Aurea94
Aurea94 2020년 5월 5일
댓글: Aurea94 2020년 5월 5일
I am trying to fit experimental data of a gear 2D measurement.
I fit external diameter with the the function circfit so that I get external radius value and real center (x,y) of the these coordinates.
Now, I would like to move this data into a centered circle in (0,0). How can I do this?
Thank you very much for your help!

채택된 답변

KSSV
KSSV 2020년 5월 5일
편집: KSSV 2020년 5월 5일
If you know Radius and center of circle, you can draw using:
R = 2. ; % say R is 2
C = [0. 0.] ; % Let center be origin
th = linspace(0,2*pi) ;
x = R*cos(th) ; y = R*sin(th) ;
xc = C(1)+x ;
yc = C(2)+y ;
plot(xc,yc) ;
As you know Radius, you can follow the above steps.
If you want to shift the center, from the circle coordinates, subtract the center, the circle will be centered at origin.
  댓글 수: 1
Aurea94
Aurea94 2020년 5월 5일
Oh my! Of course! Subtracting the real center position to all the coordinates worked!
Thanks a lot!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by