Making Art with Mathematical Equations, Inequalities and Functions (Mappings, Transformations)
Thursday, July 28, 2011
Sunday, July 24, 2011
Wednesday, July 20, 2011
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:
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:
Gnuplot 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) =
gnuplot script:
fun(x,y) = (x*x+y*y-3)*sqrt(x*x+y*y) + 0.75 \
+ sin(8*sqrt(x*x+y*y))*cos(6*atan(y/abs(x))) - 0.75*sin(5*atan(y/abs(x)))
set xrange [-2:2]
set yrange [-2:2]
set size ratio -1
set samples 512
set isosamples 512
set contour base
set cntrparam levels discrete 0
unset key
unset xtics
unset ytics
unset border
unset surface
set table 'curve.dat'
splot fun(x,y)
unset table
plot 'curve.dat' w l lw 1.5 lc rgb "red"
The result plot:
the equation fun(x,y) = 0.
fun(x,y) =
gnuplot script:
fun(x,y) = (x*x+y*y-3)*sqrt(x*x+y*y) + 0.75 \
+ sin(8*sqrt(x*x+y*y))*cos(6*atan(y/abs(x))) - 0.75*sin(5*atan(y/abs(x)))
set xrange [-2:2]
set yrange [-2:2]
set size ratio -1
set samples 512
set isosamples 512
set contour base
set cntrparam levels discrete 0
unset key
unset xtics
unset ytics
unset border
unset surface
set table 'curve.dat'
splot fun(x,y)
unset table
plot 'curve.dat' w l lw 1.5 lc rgb "red"
The result plot:
Related posts: