From: Eduardo O. <edu...@gm...> - 2022-11-18 03:07:26
|
Hi list, a few days ago I had to draw some level curves of F(x,y) := 2*x^2 - x*y - y^2; in TikZ. I was in a hurry, so I wrote something that was an uglier version of this, F(x,y) := 2*x^2 - x*y - y^2; xs(y,z) := solve(F(x,y)=z, x); maxsol(sols) := apply('max, map('rhs, sols)); minsol(sols) := apply('min, map('rhs, sols)); leftx (y,z) := minsol(xs(y,z)); rightx(y,z) := maxsol(xs(y,z)); seqn(a,b,n) := makelist(a + (b-a)*k/n, k, 0, n); leftxys (ys,z) := ev(makelist([leftx (y,z), y], y, ys), numer); rightxys(ys,z) := ev(makelist([rightx(y,z), y], y, ys), numer); leftxys (seqn(2, 0.943, 10), -1); rightxys(seqn(0.943, 2, 10), -1); but with more calls to "leftxys" and "rightxys" at the end, and then I converted the output to a series of "\draw" commands for TikZ using a throway-ish Lua program. I'm not in a hurry anymore, and now I can try to learn better ways to find the points in level curves. Questions: 1) I got lots of messages like this one: rat: replaced 0.110751 by 110751/1000000 = 0.110751 How do I silence them? And: 2) plot2d knows how to plot "contour levels". It certainly has separate functions for calculating the points of a level curve and for converting those points into commands for, say, gnuplot... is it easy to call just the function that calculates the points? How do I do that? Thanks in advance! Eduardo Ochs http://angg.twu.net/eev-maxima.html |