Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function plotcircle(coords, radius, colorSpec)
- % function plotcircle(coords, radius, colorSpec)
- % Plots a circle at given coordinates, with given radius using a given
- % color specification
- % Input coords: tuple of x and y coordinate
- % radius: radius of circle to plot
- % colorSpec: color of circle as Color Specification
- x = coords(1);
- y = coords(2);
- angle = 0:0.01:2*pi;
- xp = radius * cos(angle);
- yp = radius * sin(angle);
- plot(x + xp, y + yp, colorSpec);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement