I am wondering how I can draw circle seperated by two color...
Mostrar comentarios más antiguos
Hi.. all
As has been mentioned at title, I'd like to draw circle with two color.
For example, upper half circle is red color and lower half circle is blue color.
Which code can I use to draw this circle?
Thank you for reading my writing...
Have a nice day!
Respuestas (2)
Azzi Abdelmalek
el 25 de Oct. de 2012
Editada: Azzi Abdelmalek
el 25 de Oct. de 2012
x=-1:0.01:1
y1=sqrt(1-x.^2)
plot(y1,'r')
hold on
plot(-y1,'b')
or more general
c=1+2j % circle centre
r=4 % radius
x=real(c)-r:0.01:real(c)+r
y1=sqrt(r^2-(x-real(c)).^2)+imag(c)
plot(x,y1,'r')
hold on
plot(x,-y1+2*imag(c),'b')
axis square
Haksun Lee
el 25 de Oct. de 2012
0 votos
1 comentario
Azzi Abdelmalek
el 25 de Oct. de 2012
If you've resolved the problem then repost another question
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
