3

I want to draw algebraic curves in asymptote, but I do not know how this works. Has anyone an example?

If we want to plot for example k[x,y]/\langle x^2+y^2-1\rangle, where can I input the equation x^2-y^2-1=0? Here it is obvious that it is just a circle, but if we have several equations, this will not be so easy. Is there any command for this?

Thanks a lot for any help.

dexteritas
  • 9,161
Patricio
  • 131

1 Answers1

6

Perhaps information on Asymptote with the contour module are on Stackexchange. Indeed Asymptote provides the contour module (also the excellent smoothcontour3 module for implicitly defined 3D surfaces). For the question please consider the basic example

import contour;
import graph;
size(10cm);
real f(real x , real y)
{
  return x**3+y**3-3*x*y;
}
real [] c={-.5 , 0., .5}; // c should be an array
draw(contour(f,(-2,-2),(2,2),c));
xaxis("$x$",LeftTicks);
yaxis("$y$",RightTicks(trailingzero));

and the result

enter image description here

Other examples are available in the Asymptote documentation, with color, labels, or different pen...

O.G.

O.G.
  • 3,375