# plot a circle

Started by July 31, 2000
 i need to plot 2 lines (e.g. Ax+By+C), 2 circles (e.g.(x-h)^2 + (y-k) ^2 = r^2), and 3 points (e.g. (x1,y1), (x2,y2) & (x3,y3)) all in one plot, for instructional purposes. how do i plot a circle centered at (h,k) with radius r? thanks in advance
 hi! i am not very sure if there is a inbuilt function to draw a circle. so the best thing to do is to consider some number of points and use the equation of the circle to get the points. then u can use the plot method to plot all those points. have fun regards venu --- Franklin Rosario <> wrote: > i need to plot 2 lines (e.g. Ax+By+C), 2 circles (e.g.(x-h)^2 + (y-k) > ^2 = r^2), and 3 points (e.g. (x1,y1), (x2,y2) & (x3,y3)) all in one > plot, for instructional purposes. > how do i plot a circle centered at (h,k) with radius r? > thanks in advance > > > > To Join: > > To Post: > > To Leave: > > Archives: http://www.egroups.com/group/matlab > > More DSP-Related Groups: http://www.dsprelated.com > ===== ============================================================ Venugopal Allavatam Ph: (res.) 312-674-0898 3101. S.Wabash ave., (off.) 312-567-3869 Apt.# 410, Chicago-IL- 60616 E-mail: ============================================================ __________________________________________________
 Here is one way: h=3; k=5; r=7; N%6; t=(0:N)*2*pi/N; plot( r*cos(t)+h, r*sin(t)+k); axis('square') Franklin Rosario wrote: > > i need to plot 2 lines (e.g. Ax+By+C), 2 circles (e.g.(x-h)^2 + (y-k) > ^2 = r^2), and 3 points (e.g. (x1,y1), (x2,y2) & (x3,y3)) all in one > plot, for instructional purposes. > how do i plot a circle centered at (h,k) with radius r? > thanks in advance > > To Join: > > To Post: > > To Leave: > > Archives: http://www.egroups.com/group/matlab > > More DSP-Related Groups: http://www.dsprelated.com
 Thanks Bill! I believe this is the most efficient way given the known parameters. --- In , Bill Driscoll wrote: > Here is one way: > h=3; k=5; r=7; N%6; > t=(0:N)*2*pi/N; > plot( r*cos(t)+h, r*sin(t)+k); > axis('square')