summaryrefslogtreecommitdiff
path: root/src/c/elementaryFunctions/Trigonometry/sech
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/elementaryFunctions/Trigonometry/sech')
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/csecha.c23
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/csechs.c27
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/dsecha.c22
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/dsechs.c22
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/ssecha.c22
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/ssechs.c22
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/zsecha.c23
-rw-r--r--src/c/elementaryFunctions/Trigonometry/sech/zsechs.c27
8 files changed, 188 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/csecha.c b/src/c/elementaryFunctions/Trigonometry/sech/csecha.c
new file mode 100644
index 0000000..c8d52d8
--- /dev/null
+++ b/src/c/elementaryFunctions/Trigonometry/sech/csecha.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 "sech.h"
+#include <math.h>
+
+void csecha(floatComplex* in, int size,floatComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = csechs(in[i]);
+ }
+}
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/csechs.c b/src/c/elementaryFunctions/Trigonometry/sech/csechs.c
new file mode 100644
index 0000000..e707e8b
--- /dev/null
+++ b/src/c/elementaryFunctions/Trigonometry/sech/csechs.c
@@ -0,0 +1,27 @@
+/* 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 "sech.h"
+#include "sec.h"
+#include <math.h>
+#include "cos.h"
+#include "cosh.h"
+#include "floatComplex.h"
+#include "division.h"
+
+floatComplex csechs(floatComplex z)
+{
+
+ floatComplex out;
+ out = crdivs(FloatComplex(1,0),ccoshs(z));
+ return out;
+}
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c b/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c
new file mode 100644
index 0000000..4092c9e
--- /dev/null
+++ b/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c
@@ -0,0 +1,22 @@
+/* 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 "sech.h"
+#include <math.h>
+void dsecha(double* in,int size,double* out)
+{
+ int i=0;
+ for(i=0;i<size;i++)
+ {
+ out[i]=dsechs(in[i]);
+ }
+}
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c b/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c
new file mode 100644
index 0000000..fdcfd69
--- /dev/null
+++ b/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c
@@ -0,0 +1,22 @@
+/* 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 "sech.h"
+#include "cosh.h"
+#include "cos.h"
+
+
+double dsechs(double in)
+{
+ return (1/cosh(in));
+}
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c b/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c
new file mode 100644
index 0000000..d7e71b3
--- /dev/null
+++ b/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c
@@ -0,0 +1,22 @@
+/* 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 "sech.h"
+#include <math.h>
+void ssecha(float* in,int size,float* out)
+{
+ int i=0;
+ for(i=0;i<size;i++)
+ {
+ out[i]=ssechs(in[i]);
+ }
+}
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c b/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c
new file mode 100644
index 0000000..9fcd50b
--- /dev/null
+++ b/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c
@@ -0,0 +1,22 @@
+/* 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 "sech.h"
+#include "cosh.h"
+#include "cos.h"
+
+
+float ssechs(float in)
+{
+ return (1/cosh(in));
+}
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c b/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c
new file mode 100644
index 0000000..a3c3189
--- /dev/null
+++ b/src/c/elementaryFunctions/Trigonometry/sech/zsecha.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 "sech.h"
+#include <math.h>
+
+void zsecha(doubleComplex* in, int size,doubleComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = zsechs(in[i]);
+ }
+}
diff --git a/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c b/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c
new file mode 100644
index 0000000..d23d2ef
--- /dev/null
+++ b/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c
@@ -0,0 +1,27 @@
+/* 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 "sech.h"
+#include "sec.h"
+#include <math.h>
+#include "cos.h"
+#include "cosh.h"
+#include "doubleComplex.h"
+#include "division.h"
+
+doubleComplex zsechs(doubleComplex z)
+{
+
+ doubleComplex out;
+ out = zrdivs(DoubleComplex(1,0),zcoshs(z));
+ return out;
+}