diff options
author | Sandeep Gupta | 2017-06-18 23:55:40 +0530 |
---|---|---|
committer | Sandeep Gupta | 2017-06-18 23:55:40 +0530 |
commit | 277d1edfa17bf3719d90ddbac8e31f6181e952c3 (patch) | |
tree | 0661f1f52af0a0fd654edd4984c30e57037303c6 /src/c/elementaryFunctions/Trigonometry/sec | |
download | Scilab2C_fossee_old-277d1edfa17bf3719d90ddbac8e31f6181e952c3.tar.gz Scilab2C_fossee_old-277d1edfa17bf3719d90ddbac8e31f6181e952c3.tar.bz2 Scilab2C_fossee_old-277d1edfa17bf3719d90ddbac8e31f6181e952c3.zip |
First commit
Diffstat (limited to 'src/c/elementaryFunctions/Trigonometry/sec')
-rw-r--r-- | src/c/elementaryFunctions/Trigonometry/sec/cseca.c | 23 | ||||
-rw-r--r-- | src/c/elementaryFunctions/Trigonometry/sec/csecs.c | 25 | ||||
-rw-r--r-- | src/c/elementaryFunctions/Trigonometry/sec/dseca.c | 23 | ||||
-rw-r--r-- | src/c/elementaryFunctions/Trigonometry/sec/dsecs.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/Trigonometry/sec/sseca.c | 20 | ||||
-rw-r--r-- | src/c/elementaryFunctions/Trigonometry/sec/ssecs.c | 19 | ||||
-rw-r--r-- | src/c/elementaryFunctions/Trigonometry/sec/zseca.c | 23 | ||||
-rw-r--r-- | src/c/elementaryFunctions/Trigonometry/sec/zsecs.c | 26 |
8 files changed, 178 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/Trigonometry/sec/cseca.c b/src/c/elementaryFunctions/Trigonometry/sec/cseca.c new file mode 100644 index 0000000..fcb9b81 --- /dev/null +++ b/src/c/elementaryFunctions/Trigonometry/sec/cseca.c @@ -0,0 +1,23 @@ +/* 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: Shamik Guha + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "sec.h" +#include <math.h> + +void cseca(floatComplex* in, int size,floatComplex* out) +{ + int i = 0; + for (i=0;i<size;i++) + { + out[i] = csecs(in[i]); + } +} diff --git a/src/c/elementaryFunctions/Trigonometry/sec/csecs.c b/src/c/elementaryFunctions/Trigonometry/sec/csecs.c new file mode 100644 index 0000000..c2d9b9e --- /dev/null +++ b/src/c/elementaryFunctions/Trigonometry/sec/csecs.c @@ -0,0 +1,25 @@ +/* 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: Shamik Guha + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "sec.h" +#include "cos.h" +#include <math.h> +#include "floatComplex.h" +#include "division.h" + +floatComplex csecs(floatComplex z) +{ + + floatComplex out; + out = crdivs(FloatComplex(1,0),ccoss(z)); + return out; +} diff --git a/src/c/elementaryFunctions/Trigonometry/sec/dseca.c b/src/c/elementaryFunctions/Trigonometry/sec/dseca.c new file mode 100644 index 0000000..c39f7c6 --- /dev/null +++ b/src/c/elementaryFunctions/Trigonometry/sec/dseca.c @@ -0,0 +1,23 @@ +/* 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: Shamik Guha + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "sec.h" +#include <math.h> + +void dseca(double* in,int size,double* out) +{ + int i=0; + for(i=0;i<size;i++) + { + out[i]=1/cos(in[i]); + } +} diff --git a/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c b/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c new file mode 100644 index 0000000..5278b37 --- /dev/null +++ b/src/c/elementaryFunctions/Trigonometry/sec/dsecs.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: Shamik Guha + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <math.h> +#include "sec.h" + +double dsecs(double in) +{ + return (1/cos(in)); +} diff --git a/src/c/elementaryFunctions/Trigonometry/sec/sseca.c b/src/c/elementaryFunctions/Trigonometry/sec/sseca.c new file mode 100644 index 0000000..0ac7cc6 --- /dev/null +++ b/src/c/elementaryFunctions/Trigonometry/sec/sseca.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: Shamik Guha + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "sec.h" + +void sseca(float* in, int size, float* out) { + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = ssecs(in[i]); + } +} diff --git a/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c b/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c new file mode 100644 index 0000000..ad48000 --- /dev/null +++ b/src/c/elementaryFunctions/Trigonometry/sec/ssecs.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: Shamik Guha + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include <math.h> +#include "sec.h" + +float ssecs(float in) +{ + return (1/cos(in)); +} diff --git a/src/c/elementaryFunctions/Trigonometry/sec/zseca.c b/src/c/elementaryFunctions/Trigonometry/sec/zseca.c new file mode 100644 index 0000000..dec365d --- /dev/null +++ b/src/c/elementaryFunctions/Trigonometry/sec/zseca.c @@ -0,0 +1,23 @@ +/* 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: Shamik Guha + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "sec.h" +#include <math.h> + +void zseca(doubleComplex* in, int size,doubleComplex* out) +{ + int i = 0; + for (i=0;i<size;i++) + { + out[i] = zsecs(in[i]); + } +} diff --git a/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c b/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c new file mode 100644 index 0000000..9629db7 --- /dev/null +++ b/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c @@ -0,0 +1,26 @@ +/* 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: Shamik Guha + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#include "sec.h" +#include "cos.h" +#include <math.h> +#include "doubleComplex.h" +#include "division.h" + +doubleComplex zsecs(doubleComplex z) +{ + + doubleComplex out; + out = zrdivs(DoubleComplex(1,0),zcoss(z)); + return out; +}
\ No newline at end of file |