From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
Otared Kavian <otared@gmail.com>
Subject: Re: metafun 2
Date: Wed, 14 Aug 2019 16:49:05 +0200 [thread overview]
Message-ID: <9505678b-5603-0519-ebbf-54648417086f@xs4all.nl> (raw)
In-Reply-To: <11CA5016-D591-43F8-AEDB-DFDE99A823E2@gmail.com>
On 8/14/2019 4:22 PM, Otared Kavian wrote:
> Hi Hans,
>
> Thank you very much for the new features! I haven't yet read all the mag-1104-mkiv.pdf where you explain some of them, but after modifying one of your examples, I noticed that some funtions get a strange graph, which is probably due to the fact that metafun2 is interpolating between points in a way which is not correct.
> For instance, in the following example (which is a slight modification of yours), the curve drawn is not a graph, in the sense that for some values of x it seems to be two or more values of y.
>
> How does metafun 2 traces the curve between two discretization points?
it doesn't, it just connects the dots, so, just use a smaller step, like
xstep = .01
(The upcoming luagraph module will provide some interpolators so at some
point we can hook these in.)
(btw, there are a lot of extra math functions, also or complex numbers)
> Best regards: OK
>
> %%% begin draw-2.tex
>
> \starttext
> \startMPcode{doublefun}
> draw lmt_function [
> xmin = 1.0, xmax = 2.5066283, xstep = .1,
> ymin = -2, ymax = 2,
> % xticks = "bottom", xsmall = 80, xlarge = 20,
> % yticks = "left", ysmall = 40, ylarge = 4,
> code = "1.5 * math.sin(2*x^2)",
> xlabels = "yes",
> ylabels = "yes",
> ycaption = "\strut\tfd \rotate[rotation=90]{vertical}",
> xcaption = "\strut\tfd horizontal",
> pointsymbol = "dot", pointsize = 4, pointcolor = "orange",
> sx = 2mm, sy = 4mm, linewidth = .025mm, offset = .1mm,
> ]
> xsized 8cm ;
> \stopMPcode
>
> \stoptext
>
> %%% end draw-2.tex
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2019-08-14 14:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 9:54 Hans Hagen
2019-08-14 10:18 ` Henri Menke
2019-08-14 11:16 ` Hans Hagen
2019-08-14 11:31 ` Floris van Manen
2019-08-14 11:53 ` Hans Hagen
2019-08-15 6:05 ` Arthur Reutenauer
2019-08-14 14:22 ` Otared Kavian
2019-08-14 14:49 ` Hans Hagen [this message]
2019-08-14 14:53 ` Aditya Mahajan
2019-08-14 14:58 ` Otared Kavian
2019-08-14 15:11 ` Wolfgang Schuster
2019-08-14 15:34 ` Hans Hagen
2019-08-14 14:58 ` Mikael P. Sundqvist
2019-08-14 15:37 ` Hans Hagen
[not found] ` <CAHy-LL9D5NB6qZYj+QynCWR-rqk6suD3reepLUgO8KOwrjwnXA@mail.gmail.com>
2019-08-19 19:20 ` Fwd: " Mikael P. Sundqvist
2019-08-16 23:31 ` Adam Reviczky
2019-08-17 1:27 ` Alan Braslau
2019-08-17 8:52 ` Hans Hagen
2019-08-17 18:12 ` Adam Reviczky
2019-08-19 19:15 ` Jorge Manuel
2019-09-08 8:42 ` Aditya Mahajan
2019-09-08 10:09 ` Otared Kavian
2019-09-08 14:54 ` Aditya Mahajan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9505678b-5603-0519-ebbf-54648417086f@xs4all.nl \
--to=j.hagen@xs4all.nl \
--cc=ntg-context@ntg.nl \
--cc=otared@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).