Maybe a stupid question, but:
can MathGL draw a simple circle-part in a Cartesian plot? Or should I use y = sqrt( r - x^2 ).
Thanks ;)
Easily, just use this code
float phi1=M_PI/4, phi2=M_PI, phi; mglData x(30), y(30); for(int i=0;i<30;i++) { phi=phi1+(phi2-phi1)*i/29.; x.a[i]=cos(phi); y.a[i]=sin(phi); } gr->Plot(x,y);
or you can do the same using textual formulas
gr->Plot("cos(pi/4+(pi-pi/4)*t)", "cos(pi/4+(pi-pi/4)*t)","0");
Of course! :D
Thank you!
Log in to post a comment.
Maybe a stupid question, but:
can MathGL draw a simple circle-part in a Cartesian plot? Or should I use y =
sqrt( r - x^2 ).
Thanks ;)
Easily, just use this code
or you can do the same using textual formulas
Of course! :D
Thank you!