diff options
author | Brijeshcr | 2017-08-08 18:55:55 +0530 |
---|---|---|
committer | Brijeshcr | 2017-08-08 18:55:55 +0530 |
commit | 14fc3be8d95da244daa1fa12d519ceee8fb97eae (patch) | |
tree | cfe22ca03c32d443779d950cdd5b8ccdba78716b /src/c/elementaryFunctions/sind | |
parent | ad787796e65e1debe25871a98f9713f23d655ae4 (diff) | |
download | Scilab2C_fossee_old-14fc3be8d95da244daa1fa12d519ceee8fb97eae.tar.gz Scilab2C_fossee_old-14fc3be8d95da244daa1fa12d519ceee8fb97eae.tar.bz2 Scilab2C_fossee_old-14fc3be8d95da244daa1fa12d519ceee8fb97eae.zip |
Added Sind and Tand
Diffstat (limited to 'src/c/elementaryFunctions/sind')
-rw-r--r-- | src/c/elementaryFunctions/sind/dsinda.c | 20 | ||||
-rw-r--r-- | src/c/elementaryFunctions/sind/dsinds.c | 18 | ||||
-rw-r--r-- | src/c/elementaryFunctions/sind/ssinda.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/sind/ssinds.c | 19 |
4 files changed, 76 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/sind/dsinda.c b/src/c/elementaryFunctions/sind/dsinda.c new file mode 100644 index 0000000..c13fa0c --- /dev/null +++ b/src/c/elementaryFunctions/sind/dsinda.c @@ -0,0 +1,20 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "sind.h" + +void dsinda(double* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dsinds(x[i]); + } +} diff --git a/src/c/elementaryFunctions/sind/dsinds.c b/src/c/elementaryFunctions/sind/dsinds.c new file mode 100644 index 0000000..f7dc54f --- /dev/null +++ b/src/c/elementaryFunctions/sind/dsinds.c @@ -0,0 +1,18 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "sind.h" +#define PI 3.1415927 + +double dsinds(double x) { + return sin(x*PI/180); +} diff --git a/src/c/elementaryFunctions/sind/ssinda.c b/src/c/elementaryFunctions/sind/ssinda.c new file mode 100644 index 0000000..baefd68 --- /dev/null +++ b/src/c/elementaryFunctions/sind/ssinda.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include "sind.h" + +void ssinda(float* x, int size, double* y) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = ssinds(x[i]); + } +} diff --git a/src/c/elementaryFunctions/sind/ssinds.c b/src/c/elementaryFunctions/sind/ssinds.c new file mode 100644 index 0000000..9d5bf0e --- /dev/null +++ b/src/c/elementaryFunctions/sind/ssinds.c @@ -0,0 +1,19 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Brijesh Gupta C R + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +#include <math.h> +#include "sind.h" +#include "sin.h" +#define PI 3.1415927 + +float ssinds(float x) { + return ssins(x*PI/180); +} |