Creating a ring of stars like a flag
Show older comments
Hi,
I have these codes for a star and a circle.
% Create a light blue star
xc = 1.0;
yc = 3.0;
t = (-1/4:1/10:3/4)*2*pi;
r1 = 0.5;
r2 = 0.2;
r = (r1+r2)/2 + (r1-r2)/2*(-1).^[0:10];
x = r.*cos(t) + xc;
y = r2 - r.*sin(t) + yc;
c = [0.6 0.8 1.0];
fill(x, y, c)
function h = circle(x,y,r)
hold on
th = 0:pi/50:2*pi;
xunit = r * cos(th) + x;
yunit = r * sin(th) + y;
h = plot(xunit, yunit);
hold off
How would I go about creating a a circle but instead of a circumference I have exactly 12 stars around the circumference and the radius from the centre would be 6. I am trying to create the EU flag. which has 12 stars and a radius of 6 according to wikipedia. Thanks for the help.
Accepted Answer
More Answers (0)
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!