Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

28485 views
License: GPL3
ubuntu2004
1
/* Copyright (C) 2000 The PARI group.
2
3
This file is part of the PARI/GP package.
4
5
PARI/GP is free software; you can redistribute it and/or modify it under the
6
terms of the GNU General Public License as published by the Free Software
7
Foundation; either version 2 of the License, or (at your option) any later
8
version. It is distributed in the hope that it will be useful, but WITHOUT
9
ANY WARRANTY WHATSOEVER.
10
11
Check the License for details. You should have received a copy of it, along
12
with the package; see the file 'COPYING'. If not, write to the Free Software
13
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
14
15
/*******************************************************************/
16
/* HIGH RESOLUTION PLOT VIA POSTSCRIPT FILE */
17
/*******************************************************************/
18
#include "pari.h"
19
#include "rect.h"
20
21
static void
22
draw(PARI_plot *T, GEN w, GEN x, GEN y)
23
{
24
if (pari_daemon()) return; /* parent process returns */
25
pari_plot_by_file("GP_POSTSCRIPT_VIEWER", ".ps", rect2ps_i(w,x,y,T,1));
26
exit(0);
27
}
28
29
void
30
gp_get_plot(PARI_plot *T)
31
{
32
T->width = 400;
33
T->height = 300;
34
T->fheight= 9;
35
T->fwidth = 5;
36
T->hunit = 3;
37
T->vunit = 3;
38
gp_get_ploth_default_sizes(T);
39
T->dwidth = 0;
40
T->dheight= 0;
41
T->draw = &draw;
42
}
43
44