manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1.3 Tens sample

../png/tens

C++ code

mglData y(50), c(50);
y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)");
c.Modify("sin(2*pi*x)");
gr->Box();
gr->Tens(y,c);

MGL code

new y 50
new c 50
modify y '0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)'
modify c 'sin(2*pi*x)'
box
tens y c

Pure C code

HMDT y = mgl_create_data_size(50,1,1);
HMDT c = mgl_create_data_size(50,1,1);
mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0);
mgl_data_modify(c,"sin(2*pi*x)",0);
mgl_box(gr,1);
mgl_tens(gr,y,c,NULL);
mgl_delete_data(y);
mgl_delete_data(c);

Fortran code

integer y, c, mgl_create_data_size
y = mgl_create_data_size(50,1,1)
c = mgl_create_data_size(50,1,1)
call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0)
call mgl_data_modify(c,'sin(2*pi*x)',0)
call mgl_box(gr,1)
call mgl_tens(gr,y,'')
call mgl_delete_data(y)
call mgl_delete_data(c)

Python

y = mglData(50);
c = mglData(50);
y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)");
c.Modify("sin(2*pi*x)");
gr.Box();
gr.Tens(y,c);

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.