필터 지우기
필터 지우기

Drawing a semi-circle in Matlab about a point

조회 수: 107 (최근 30일)
Stuart
Stuart 2012년 3월 13일
답변: Krithik 2022년 12월 29일
Hi,
There seem to be several different ways to draw a semi-circle according to google, however none of the answers seem to give me what I need.
I would like a semi-circle (from twelve to six, if it were a clock) about the point (5,4),
Does anyone know how to do this?
I have tried rectangle with curvature, polar coodinates and the equation of a circle, but something always seems to go wrong.
This gets me closest:
theta = 0:.01:pi-pi/2; y = 1.8*exp((1j)*theta)+5.8; plot(real(y),imag(y)); axis([0 28 0 15]); axis equal;
However the centre of the circle is on the x axis and not at y=4.5.
Thanks for your help.

채택된 답변

Matt Kindig
Matt Kindig 2012년 3월 13일
th = linspace( pi/2, -pi/2, 100);
R = 1; %or whatever radius you want
x = R*cos(th) + 5;
y = R*sin(th) + 4;
plot(x,y); axis equal;

추가 답변 (1개)

Krithik
Krithik 2022년 12월 29일
th = linspace( pi/2, -pi/2, 100); R = 1; %or whatever radius you want x = R*cos(th) + 5; y = R*sin(th) + 4; plot(x,y); axis equal;

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by