Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function plotcircle(coords, radius, colorSpec)
  2. % function plotcircle(coords, radius, colorSpec)
  3. % Plots a circle at given coordinates, with given radius using a given
  4. % color specification
  5. % Input coords: tuple of x and y coordinate
  6. % radius: radius of circle to plot
  7. % colorSpec: color of circle as Color Specification
  8. x = coords(1);
  9. y = coords(2);
  10. angle = 0:0.01:2*pi;
  11. xp = radius * cos(angle);
  12. yp = radius * sin(angle);
  13. plot(x + xp, y + yp, colorSpec);
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement