Re: [NTG-context] Implicit plots/level curves possible?

2018-10-11 Thread Aditya Mahajan
On Tue, 9 Oct 2018, Alan Braslau wrote: On Mon, 8 Oct 2018 17:56:24 -0400 (EDT) Aditya Mahajan wrote: Here is a proof of concept implementation in Lua + MP so that you can use: \ContourPlot [ function=2*x^5 + x*y + y^5, x={0, 2}, y={-2, 0.5}, n=1000, % Number of

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-09 Thread Alan Braslau
On Mon, 8 Oct 2018 17:56:24 -0400 (EDT) Aditya Mahajan wrote: > Here is a proof of concept implementation in Lua + MP so that you can use: > > \ContourPlot >[ > function=2*x^5 + x*y + y^5, > x={0, 2}, > y={-2, 0.5}, > n=1000, % Number of discretization points >] > >

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-09 Thread Mikael P. Sundqvist
Wow! This is cool! I must admit I do not get how the connections between MetaPost and Lua works, but it seem to work fine. Challenge: To do this for a more complicated closed and self-intersecting curve like the Bernoulli lemniscate, say (x^2+y^2)^2=x^2-y^2 (a good domain could be -1.5 wrote: >

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-08 Thread Hans Hagen
On 10/8/2018 11:25 PM, Aditya Mahajan wrote: On Mon, 8 Oct 2018, Alan Braslau wrote: On Mon, 8 Oct 2018 16:00:10 -0400 (EDT) Aditya Mahajan wrote: On Sun, 7 Oct 2018, Hans Hagen wrote: On 10/7/2018 7:14 PM, Alan Braslau wrote: On Sun, 7 Oct 2018 17:25:35 +0200 "Mikael P. Sundqvist"

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-08 Thread Aditya Mahajan
On Mon, 8 Oct 2018, Aditya Mahajan wrote: On Mon, 8 Oct 2018, Alan Braslau wrote: On Mon, 8 Oct 2018 16:00:10 -0400 (EDT) Aditya Mahajan wrote: On Sun, 7 Oct 2018, Hans Hagen wrote: On 10/7/2018 7:14 PM, Alan Braslau wrote: On Sun, 7 Oct 2018 17:25:35 +0200 "Mikael P. Sundqvist" wrote:

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-08 Thread Alan Braslau
On Mon, 8 Oct 2018 17:25:24 -0400 (EDT) Aditya Mahajan wrote: > > (then eps should be made a linear function of xi) > > Oh, I missed that. Thanks. This is because the function is O(xy) for small x so one will get oscillations in the curve (multiple hits in the grid search) otherwise. Alan

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-08 Thread Aditya Mahajan
On Mon, 8 Oct 2018, Alan Braslau wrote: On Mon, 8 Oct 2018 16:00:10 -0400 (EDT) Aditya Mahajan wrote: On Sun, 7 Oct 2018, Hans Hagen wrote: On 10/7/2018 7:14 PM, Alan Braslau wrote: On Sun, 7 Oct 2018 17:25:35 +0200 "Mikael P. Sundqvist" wrote: ContourPlot[2 x^5 + x y + y^5 == 0, {x,

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-08 Thread Alan Braslau
On Mon, 8 Oct 2018 16:00:10 -0400 (EDT) Aditya Mahajan wrote: > On Sun, 7 Oct 2018, Hans Hagen wrote: > > > On 10/7/2018 7:14 PM, Alan Braslau wrote: > >> On Sun, 7 Oct 2018 17:25:35 +0200 > >> "Mikael P. Sundqvist" wrote: > >> > >>> ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2,

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-08 Thread Aditya Mahajan
On Sun, 7 Oct 2018, Hans Hagen wrote: On 10/7/2018 7:14 PM, Alan Braslau wrote: On Sun, 7 Oct 2018 17:25:35 +0200 "Mikael P. Sundqvist" wrote: ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2, 1/2}] Brut force: [...] as this takes some time here's a cheat: \starttext

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-07 Thread Hans Hagen
On 10/7/2018 7:14 PM, Alan Braslau wrote: On Sun, 7 Oct 2018 17:25:35 +0200 "Mikael P. Sundqvist" wrote: ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2, 1/2}] Brut force: \startTEXpage \startMPcode {doublefun} pen savedpen ; savedpen := currentpen ; pickup pencircle scaled .01 ;

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-07 Thread Mikael P. Sundqvist
On Sun, Oct 7, 2018 at 7:14 PM Alan Braslau wrote: > > On Sun, 7 Oct 2018 17:25:35 +0200 > "Mikael P. Sundqvist" wrote: > > > ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2, 1/2}] > > Brut force: > > \startTEXpage > \startMPcode {doublefun} > pen savedpen ; savedpen := currentpen ; >

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-07 Thread Alan Braslau
On Sun, 7 Oct 2018 17:25:35 +0200 "Mikael P. Sundqvist" wrote: > ContourPlot[2 x^5 + x y + y^5 == 0, {x, 0, 2}, {y, -2, 1/2}] Brut force: \startTEXpage \startMPcode {doublefun} pen savedpen ; savedpen := currentpen ; pickup pencircle scaled .01 ; path p ; p := for i=0 upto 1000 : for

Re: [NTG-context] Implicit plots/level curves possible?

2018-10-07 Thread luigi scarso
On Sun, Oct 7, 2018 at 5:26 PM Mikael P. Sundqvist wrote: > Dear list, > > Is it possiblet to make implicit plots (i.e. ploting the curves > described by equations) in MetaFun? I cannot find anything about them > in the MetaFun manual. > > For example, in Mathematica I can write something like >