source: Sophya/trunk/SophyaLib/NTools/tabmath.cc@ 1474

Last change on this file since 1474 was 1371, checked in by ansari, 25 years ago

MAJ documentation, Makefile, ... - Reza 5/1/2001

File size: 676 bytes
Line 
1#include "machdefs.h"
2#include "tabmath.h"
3
4///////////////////////////////
5// Exponentielles tabulees //
6///////////////////////////////
7
8TabFExp::TabFExp()
9{
10 tab = new double[10000];
11
12 for(int i=0; i<10000; i++)
13 tab[i] = exp(-(double)i*0.001) ;
14}
15
16TabFExp::~TabFExp()
17{
18 delete[] tab;
19}
20
21TabFExp* SOPHYA::ptabFExp;
22
23////////////////////////////////////
24// Sinus tabules (et Cosinus) //
25////////////////////////////////////
26
27TabFSin::TabFSin(int n)
28{
29 if(n<=1) n=10000;
30 tab = new double[n];
31 delta = Pi/2. / (double) (n-1);
32 for(int i=0; i<n; i++)
33 tab[i] = sin((double)i* delta) ;
34}
35
36TabFSin::~TabFSin()
37{
38 delete[] tab;
39}
40
41TabFSin* SOPHYA::ptabFSin;
Note: See TracBrowser for help on using the repository browser.