Tuesday, July 19, 2011

UDAV example: plotting implicit curves (level curves)

In this example, we will plot the implicit curve (level curve, contour line) defined by
the equation fun(x,y) = 0.

fun(x,y) =


MGL script:

setsize 400 400
plotfactor 1
xrange -2 2
yrange -2 2
new fun 512 512
list v 0
fill fun '(x*x+y*y-3)*sqrt(x*x+y*y) + 0.75 + 0.5*sin(4*sqrt(x*x+y*y))*cos(5*atan(y/abs(x))) - sin(5*atan(y/abs(x)))'
cont v fun 'r'


The following image shows the result:


No comments:

Post a Comment