[NTG-context] functions and paths in metapost

Hans Hagen pragma at wxs.nl
Mon Oct 14 22:56:59 CEST 2013


On 10/14/2013 2:38 PM, Jean Magnan de Bornier wrote:
> Hello all,
>
> Is it possible to define a path in metapost-metafun using "function"? In
> the metafun manual (chapter on Functions) the examples shown are all of
> the type "draw function ...". I wonder if it is possible to define a path
> with a function ("picture" after draw doesn't allow that afaik)?

there are some helpers in the new graph module, but Alan has to give an 
example

% least-squares "fit" to a polynomial
%
% example :
%
%   path p[] ;
%   numeric a[] ; a0 := 1 ; a1 := .1 ; a2 := .01 ; a3 := .001 ; a4 := 
0.0001 ;
%   p0 := makefunctionpath(0,5,10,polynomial_function(a,4,x)) ;

(it fails here so I probably misunderstand it)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list