How can i create a function that returns the x and y coordinate of a circle with given center, radius an interval from 0 to 2*pi?

5 次查看(过去 30 天)
How can i create a function that returns the x and y coordinate of a circle with given center, radius an interval from 0 to 2*pi?
  5 个评论
Rik
Rik 2020-5-3
Look at how you are generating the t vector. That would be a way to make your circle look a lot more like a circle.

请先登录,再进行评论。

回答(1 个)

Maadhav Akula
Maadhav Akula 2020-5-6
Hi,
According to your comments I think you just want a particular point (x,y co-ordinates) on a circle. For that you should also pass the angle value too. You got the function almost right, I have modified it a little:
function [x,y] = getCircle(xm,ym,radius,t)
x = radius*cos(t)+xm;
y = radius*sin(t)+ym;
end
where t can lie between the interval [0,2*pi] in radians.
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by