Write the function getCircle which is called as [x,y]=getCircle(center,radius)
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
to get the x and y coordinates of points that fall on a circle. The circle should be centered at center (2-element vector containing the x and y values of the center) and have the provided radius. The function should return x and y such that a call to plot(x,y) will plot the circle. Note that going around a circle centered on the origin is going around from angle t = 0 to 2pi. In this case the x and y coordinates on a unit circle centered on the origin of radius 1 are x(t ) = cos (t )and y(t) = sin(t). The points can be scaled to the correct radius by multiplying by radius. The point can translated to have a center other than the origin by adding the center to each point. Write a program that uses getCircle to draw circles and makes a plot with 3 circles of radius 1,3,5 centered on (6,6) and 3 circles of radius 1,3,5 centered on (-6,6). The circles of radius 1,3, and 5 should be of different colors, and should use the same color for each value of radius in the two sets of circles.
0 comentarios
Respuestas (1)
Image Analyst
el 13 de Feb. de 2018
The FAQ on creating a circle should give you a good start: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F
0 comentarios
Ver también
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!