Drawing a semi-circle in Matlab about a point
109 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
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
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;
0 个评论
另请参阅
类别
在 Help Center 和 File 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!