summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/elementaryFunctions/Trigonometry
diff options
context:
space:
mode:
authorsiddhu89902017-04-19 14:57:49 +0530
committersiddhu89902017-04-19 14:57:49 +0530
commitb9cfdca438347fe4d28f7caff3cb7b382e455d3a (patch)
tree948593b7d89741f804919a74f2e5e34b39adb0a0 /2.3-1/src/c/elementaryFunctions/Trigonometry
parent586db6343e7b472d8dc3e63a82f4c73f99cdcbd7 (diff)
downloadScilab2C-b9cfdca438347fe4d28f7caff3cb7b382e455d3a.tar.gz
Scilab2C-b9cfdca438347fe4d28f7caff3cb7b382e455d3a.tar.bz2
Scilab2C-b9cfdca438347fe4d28f7caff3cb7b382e455d3a.zip
Merged Shamik's work
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/Trigonometry')
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c14
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c9
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c16
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c9
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c9
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c7
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/coth/ccotha.c12
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/coth/ccoths.c14
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/coth/dcotha.c14
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/coth/dcoths.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/coth/scotha.c14
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/coth/scoths.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/coth/zcotha.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/coth/zcoths.c14
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csc/ccsca.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csc/ccscs.c16
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csc/dcsca.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csc/dcscs.c9
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csc/scsca.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csc/scscs.c9
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csc/zcsca.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csc/zcscs.c19
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/ccscda.c12
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/ccscds.c17
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/dcscda.c15
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/dcscds.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/scscda.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/scscds.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/zcscda.c12
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/zcscds.c17
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csch/ccscha.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csch/ccschs.c14
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csch/dcscha.c8
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csch/dcschs.c9
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csch/scscha.c8
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csch/scschs.c9
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csch/zcscha.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/csch/zcschs.c14
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sec/cseca.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sec/csecs.c13
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sec/dseca.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c7
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sec/sseca.c8
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c7
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sec/zseca.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c57
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/secd/dsecda.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/secd/dsecds.c8
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/secd/ssecda.c9
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/secd/ssecds.c7
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sech/csecha.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sech/csechs.c15
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c10
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c11
-rw-r--r--2.3-1/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c15
60 files changed, 720 insertions, 0 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c
new file mode 100644
index 00000000..b48876e3
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c
@@ -0,0 +1,14 @@
+#include "cosd.h"
+#include <math.h>
+
+void dcosda(double* in,int size,double* out)
+{
+ double val=0.0;
+ val =3.14159265/180.0;
+ int i=0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = cos(in[i]*val);
+ }
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c
new file mode 100644
index 00000000..45507577
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c
@@ -0,0 +1,11 @@
+#include <math.h>
+#include "cos.h"
+#include "cosd.h"
+
+double dcosds(double in)
+{
+ if(cos((M_PI/180.0)*in)==0.0)
+ return 0.0;
+ else
+ return (cos((M_PI/180.0)*in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c
new file mode 100644
index 00000000..5224899b
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c
@@ -0,0 +1,9 @@
+#include "cos.h"
+#include "cosd.h"
+
+void scosda(float* in, int size, float* out) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ out[i] = scosds(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c
new file mode 100644
index 00000000..e99a1952
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c
@@ -0,0 +1,11 @@
+#include <math.h>
+#include "cosd.h"
+#include "cos.h"
+
+float scosds(float in)
+{
+ if(cosf((M_PI/180.0)*in)==0.0)
+ return 0.0;
+ else
+ return (cosf((M_PI/180.0)*in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c
new file mode 100644
index 00000000..3cf032a1
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c
@@ -0,0 +1,16 @@
+#include "cotd.h"
+#include <math.h>
+#define PI 3.14159265
+
+void dcotda(double* in,int size,double* out)
+{
+ double val;
+ int i=0;
+ val = PI / 180.0;
+ for(i=0;i<size;i++)
+ {
+ out[i]=1/tan(in[i]*val);
+ /*printf("The cotangent of %lf degrees is %lf \n", in[i], out[i]);*/
+ }
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c
new file mode 100644
index 00000000..4ba95b84
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c
@@ -0,0 +1,9 @@
+#include <math.h>
+#include "cotd.h"
+
+double dcotds(double in)
+{
+if(in==0)
+printf("Inf\n");
+ return (1/tan((M_PI/180.0)*in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c
new file mode 100644
index 00000000..fd5a1e11
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c
@@ -0,0 +1,9 @@
+
+#include "cotd.h"
+
+void scotda(float* in, int size, float* out) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ out[i] = scosds(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c
new file mode 100644
index 00000000..d635dbcd
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c
@@ -0,0 +1,7 @@
+#include <math.h>
+#include "cotd.h"
+
+float scotds(float in)
+{
+ return (1/tanf((M_PI/180.0)*in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/ccotha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/ccotha.c
new file mode 100644
index 00000000..4e794512
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/ccotha.c
@@ -0,0 +1,12 @@
+#include "coth.h"
+#include <math.h>
+
+void ccotha(floatComplex* in, int size,floatComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = ccoths(in[i]);
+ }
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/ccoths.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/ccoths.c
new file mode 100644
index 00000000..564b8e69
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/ccoths.c
@@ -0,0 +1,14 @@
+#include <math.h>
+#include "coth.h"
+#include <math.h>
+#include "tanh.h"
+#include "floatComplex.h"
+#include "division.h"
+
+floatComplex ccoths(floatComplex z)
+{
+
+ floatComplex out;
+ out = crdivs(FloatComplex(1,0), ctanhs(z));
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/dcotha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/dcotha.c
new file mode 100644
index 00000000..f6304f58
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/dcotha.c
@@ -0,0 +1,14 @@
+#include "coth.h"
+#include <math.h>
+
+void dcotha(double* in,int size,double* out)
+{
+ double val;
+ int i=0;
+ for(i=0;i<size;i++)
+ {
+ out[i]=cosh(in[i])/sinh(in[i]);
+ /*printf("The cotangent of %lf is %lf\n", in[i], out[i]);*/
+ }
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/dcoths.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/dcoths.c
new file mode 100644
index 00000000..bf6bb78d
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/dcoths.c
@@ -0,0 +1,10 @@
+#include <math.h>
+#include "coth.h"
+#include "cosh.h"
+#include "cos.h"
+#include "sinh.h"
+#include "sin.h"
+
+double dcoths(double in) {
+ return (cosh(in)/sinh(in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/scotha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/scotha.c
new file mode 100644
index 00000000..3fdf37f7
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/scotha.c
@@ -0,0 +1,14 @@
+#include "coth.h"
+#include <math.h>
+
+void scotha(float* in,int size,float* out)
+{
+ float val;
+ int i=0;
+ for(i=0;i<size;i++)
+ {
+ out[i]=cosh(in[i])/sinh(in[i]);
+ /*printf("The cotangent of %lf is %lf\n", in[i], out[i]);*/
+ }
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/scoths.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/scoths.c
new file mode 100644
index 00000000..107945e5
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/scoths.c
@@ -0,0 +1,10 @@
+#include <math.h>
+#include "coth.h"
+#include "cosh.h"
+#include "cos.h"
+#include "sinh.h"
+#include "sin.h"
+
+float scoths(float in) {
+ return (cosh(in)/sinh(in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/zcotha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/zcotha.c
new file mode 100644
index 00000000..dcbb2844
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/zcotha.c
@@ -0,0 +1,11 @@
+#include "coth.h"
+#include <math.h>
+
+void zcotha(doubleComplex* in, int size,doubleComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = zcoths(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/zcoths.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/zcoths.c
new file mode 100644
index 00000000..2eed86bb
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/coth/zcoths.c
@@ -0,0 +1,14 @@
+#include "coth.h"
+#include "tanh.h"
+#include "tan.h"
+#include <math.h>
+#include "doubleComplex.h"
+#include "division.h"
+
+doubleComplex zcoths(doubleComplex z)
+{
+
+ doubleComplex out;
+ out = zrdivs(DoubleComplex(1,0),ztanhs(z));
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/ccsca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/ccsca.c
new file mode 100644
index 00000000..5f5504a5
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/ccsca.c
@@ -0,0 +1,11 @@
+#include "csc.h"
+#include <math.h>
+
+void ccsca(floatComplex* in, int size,floatComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = ccscs(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/ccscs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/ccscs.c
new file mode 100644
index 00000000..af8b3eb2
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/ccscs.c
@@ -0,0 +1,16 @@
+#include <math.h>
+#include "sin.h"
+#include "cos.h"
+#include "sinh.h"
+#include "cosh.h"
+#include "csc.h"
+#include "floatComplex.h"
+#include "division.h"
+
+floatComplex ccscs(floatComplex z)
+{
+
+ floatComplex out;
+ out = crdivs(FloatComplex(1,0),csins(z));
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/dcsca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/dcsca.c
new file mode 100644
index 00000000..eeedea52
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/dcsca.c
@@ -0,0 +1,10 @@
+#include "csc.h"
+
+void dcsca(double* in,int size,double* out)
+{
+ int i = 0;
+ for (i = 0;i<size;++i)
+ {
+ out[i] = dcscs(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/dcscs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/dcscs.c
new file mode 100644
index 00000000..31a6944e
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/dcscs.c
@@ -0,0 +1,9 @@
+#include "csc.h"
+#include <math.h>
+
+double dcscs(double in)
+{
+ double out;
+ out=1/sin(in);
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/scsca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/scsca.c
new file mode 100644
index 00000000..3e6963ac
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/scsca.c
@@ -0,0 +1,10 @@
+#include "csc.h"
+
+void scsca(float* in,int size,float* out)
+{
+ int i = 0;
+ for (i = 0;i<size;++i)
+ {
+ out[i] = scscs(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/scscs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/scscs.c
new file mode 100644
index 00000000..6d1b1b7f
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/scscs.c
@@ -0,0 +1,9 @@
+#include "csc.h"
+#include <math.h>
+
+float scscs(float in)
+{
+ float out;
+ out=1/sin(in);
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/zcsca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/zcsca.c
new file mode 100644
index 00000000..4b8cdad6
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/zcsca.c
@@ -0,0 +1,11 @@
+#include "csc.h"
+#include <math.h>
+
+void zcsca(doubleComplex* in, int size,doubleComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = zcscs(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/zcscs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/zcscs.c
new file mode 100644
index 00000000..c0b692dc
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csc/zcscs.c
@@ -0,0 +1,19 @@
+#include <math.h>
+#include "sin.h"
+#include "cos.h"
+#include "sinh.h"
+#include "cosh.h"
+#include "csc.h"
+#include "doubleComplex.h"
+#include "division.h"
+
+doubleComplex zcscs(doubleComplex z)
+{
+ doubleComplex out;
+ //out = zrdivs(DoubleComplex(1,0),zsins(z));
+ double real = zreals(z);
+ double imag = zimags(z);
+ printf("%d , %d",real,imag);
+return zrdivs(1+0*%i,(DoubleComplex(dsins(real) * dcoshs(imag), dcoss(real) * dsinhs(imag))));
+ //return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/ccscda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/ccscda.c
new file mode 100644
index 00000000..d18d3c71
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/ccscda.c
@@ -0,0 +1,12 @@
+#include "csc.h"
+#include "cscd.h"
+#include <math.h>
+
+void ccscda(floatComplex* in, int size,floatComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = ccscds(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/ccscds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/ccscds.c
new file mode 100644
index 00000000..8f1f9f75
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/ccscds.c
@@ -0,0 +1,17 @@
+#include <math.h>
+#include "sin.h"
+#include "cos.h"
+#include "sinh.h"
+#include "cosh.h"
+#include "csc.h"
+#include "cscd.h"
+#include "floatComplex.h"
+#include "division.h"
+
+floatComplex ccscds(floatComplex z)
+{
+
+ floatComplex out;
+ out = crdivs(FloatComplex(1,0),csins(z));
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/dcscda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/dcscda.c
new file mode 100644
index 00000000..43e00430
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/dcscda.c
@@ -0,0 +1,15 @@
+#include "cscd.h"
+#include <math.h>
+#define PI 3.14159265
+
+void dcscda(double* in,int size,double* out)
+{
+ double val;
+ int i=0;
+ val = PI / 180.0;
+ for(i=0;i<size;i++)
+ {
+ out[i]=1/sin(in[i]*val);
+ }
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/dcscds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/dcscds.c
new file mode 100644
index 00000000..d9a0df9a
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/dcscds.c
@@ -0,0 +1,11 @@
+#include "cscd.h"
+#include <math.h>
+
+double dcscds(double in)
+{
+ double val;
+ val = (M_PI) / 180.0;
+ double out;
+ out=1/sin(in*val);
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/scscda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/scscda.c
new file mode 100644
index 00000000..761d9413
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/scscda.c
@@ -0,0 +1,10 @@
+#include "cscd.h"
+
+void scscda(float* in,int size,float* out)
+{
+ int i = 0;
+ for (i = 0;i<size;++i)
+ {
+ out[i] = scscds(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/scscds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/scscds.c
new file mode 100644
index 00000000..d4348549
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/scscds.c
@@ -0,0 +1,10 @@
+#include "cscd.h"
+#include <math.h>
+
+float scscds(float in)
+{
+ float out,val;
+ val=(M_PI)/180.0;
+ out=1/sin(in*val);
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/zcscda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/zcscda.c
new file mode 100644
index 00000000..02f9e3b2
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/zcscda.c
@@ -0,0 +1,12 @@
+#include "csc.h"
+#include "cscd.h"
+#include <math.h>
+
+void zcscda(doubleComplex* in, int size,doubleComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = zcscds(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/zcscds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/zcscds.c
new file mode 100644
index 00000000..351c8ff2
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cscd/zcscds.c
@@ -0,0 +1,17 @@
+#include <math.h>
+#include "sin.h"
+#include "cos.h"
+#include "sinh.h"
+#include "cosh.h"
+#include "csc.h"
+#include "cscd.h"
+#include "doubleComplex.h"
+#include "division.h"
+
+doubleComplex zcscds(doubleComplex z)
+{
+
+ doubleComplex out;
+ out = zrdivs(DoubleComplex(1,0),zsins(z));
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/ccscha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/ccscha.c
new file mode 100644
index 00000000..02a9ec1d
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/ccscha.c
@@ -0,0 +1,11 @@
+#include "csch.h"
+#include <math.h>
+
+void ccscha(floatComplex* in, int size,floatComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = ccschs(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/ccschs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/ccschs.c
new file mode 100644
index 00000000..177a9fa4
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/ccschs.c
@@ -0,0 +1,14 @@
+#include "csch.h"
+#include "sinh.h"
+#include "sin.h"
+#include <math.h>
+#include "floatComplex.h"
+#include "division.h"
+
+floatComplex ccschs(floatComplex z)
+{
+
+ floatComplex out;
+ out = crdivs(FloatComplex(1,0),csinhs(z));
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/dcscha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/dcscha.c
new file mode 100644
index 00000000..ce87b6f8
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/dcscha.c
@@ -0,0 +1,8 @@
+#include "csch.h"
+
+void dcscha(double* in, int size, double* out) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ out[i] = dcschs(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/dcschs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/dcschs.c
new file mode 100644
index 00000000..3b22544f
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/dcschs.c
@@ -0,0 +1,9 @@
+#include "csch.h"
+#include <math.h>
+
+double dcschs(double in)
+{
+ double out;
+ out=1/sinh(in);
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/scscha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/scscha.c
new file mode 100644
index 00000000..880ffaae
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/scscha.c
@@ -0,0 +1,8 @@
+#include "csch.h"
+
+void scscha(float* in, int size, float* out) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ out[i] = scschs(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/scschs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/scschs.c
new file mode 100644
index 00000000..8cd4e628
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/scschs.c
@@ -0,0 +1,9 @@
+#include "csch.h"
+#include <math.h>
+
+float scschs(float in)
+{
+ float out;
+ out=1/sinh(in);
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/zcscha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/zcscha.c
new file mode 100644
index 00000000..ae659dec
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/zcscha.c
@@ -0,0 +1,11 @@
+#include "csch.h"
+#include <math.h>
+
+void zcscha(doubleComplex* in, int size,doubleComplex* out)
+{
+ int i = 0;
+ for (i=0;i<size;i++)
+ {
+ out[i] = zcschs(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/zcschs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/zcschs.c
new file mode 100644
index 00000000..f3a9b227
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/csch/zcschs.c
@@ -0,0 +1,14 @@
+#include "csch.h"
+#include "sinh.h"
+#include "sin.h"
+#include <math.h>
+#include "doubleComplex.h"
+#include "division.h"
+
+doubleComplex zcschs(doubleComplex z)
+{
+
+ doubleComplex out;
+ out = zrdivs(DoubleComplex(1,0),zsinhs(z));
+ return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/cseca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/cseca.c
new file mode 100644
index 00000000..139360af
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/cseca.c
@@ -0,0 +1,11 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/csecs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/csecs.c
new file mode 100644
index 00000000..51ea2242
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/csecs.c
@@ -0,0 +1,13 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/dseca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/dseca.c
new file mode 100644
index 00000000..986b52f3
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/dseca.c
@@ -0,0 +1,11 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c
new file mode 100644
index 00000000..9135ad14
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/dsecs.c
@@ -0,0 +1,7 @@
+#include <math.h>
+#include "sec.h"
+
+double dsecs(double in)
+{
+ return (1/cos(in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/sseca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/sseca.c
new file mode 100644
index 00000000..f5fd81bc
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/sseca.c
@@ -0,0 +1,8 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c
new file mode 100644
index 00000000..2c9e018f
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/ssecs.c
@@ -0,0 +1,7 @@
+#include <math.h>
+#include "sec.h"
+
+float ssecs(float in)
+{
+ return (1/cos(in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/zseca.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/zseca.c
new file mode 100644
index 00000000..7a80291f
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/zseca.c
@@ -0,0 +1,11 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c
new file mode 100644
index 00000000..b5468db5
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sec/zsecs.c
@@ -0,0 +1,57 @@
+/*//#include "sec.h"
+//#include "cos.h"
+//#include <math.h>
+//#include "doubleComplex.h"
+//#include "division.h"
+*/
+
+/*#include <math.h>
+#include "sin.h"
+#include "cos.h"
+#include "sinh.h"
+#include "cosh.h"
+#include "csc.h"
+#include "division.h"
+*/
+#include <complex.h>
+#include <stdio.h>
+
+/*doubleComplex zsecs(doubleComplex z)
+{
+
+ doubleComplex out;
+ out = zrdivs(DoubleComplex(1,0),zcoss(z));
+ return out;
+}
+*/
+void zsecs(double complex z)
+{
+
+ //double complex out;
+ /*out = zrdivs(DoubleComplex(1,0),zcoss(z));
+ return out;
+}*/
+
+ double complex out = 1.0/(ccos(z));
+ if(cimag(out)==0.0)
+ {
+ printf("%.7lf\n",creal(out));
+ //out=creal(out);
+ }
+ else if(creal(out)==0.0)
+ {
+ printf("%.7lfi\n",cimag(out));
+ //out=cimag(out);
+ }
+ else if(creal(out)!=0.0 && cimag(out)<0.0)
+ {
+ printf("%.7lf %.7lfi\n",creal(out),cimag(out));
+ //out=x;
+ }
+ else
+ {
+ printf("%.7lf + %.7lfi\n", creal(out), cimag(out));
+ //out=x;
+ }
+ //return out;
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/dsecda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/dsecda.c
new file mode 100644
index 00000000..028595cd
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/dsecda.c
@@ -0,0 +1,11 @@
+#include "secd.h"
+#include <math.h>
+
+void dsecda(double* in,int size,double* out)
+{
+ int i=0;
+ for(i=0;i<size;i++)
+ {
+ out[i]=dsecds(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/dsecds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/dsecds.c
new file mode 100644
index 00000000..7b08a467
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/dsecds.c
@@ -0,0 +1,8 @@
+#include <math.h>
+#include "sec.h"
+#include "secd.h"
+
+double dsecds(double in)
+{
+ return (1/cos((M_PI/180.0)*in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/ssecda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/ssecda.c
new file mode 100644
index 00000000..6267f943
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/ssecda.c
@@ -0,0 +1,9 @@
+#include "sec.h"
+#include "secd.h"
+
+void ssecda(float* in, int size, float* out) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ out[i] = ssecds(in[i]);
+ }
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/ssecds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/ssecds.c
new file mode 100644
index 00000000..3fabb225
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/secd/ssecds.c
@@ -0,0 +1,7 @@
+#include <math.h>
+#include "secd.h"
+#include "sec.h"
+
+float ssecds(float in) {
+ return (1/cos((M_PI/180.0)*in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/csecha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/csecha.c
new file mode 100644
index 00000000..dcd76d59
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/csecha.c
@@ -0,0 +1,11 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/csechs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/csechs.c
new file mode 100644
index 00000000..37ba6d95
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/csechs.c
@@ -0,0 +1,15 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c
new file mode 100644
index 00000000..cfab81ff
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/dsecha.c
@@ -0,0 +1,10 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c
new file mode 100644
index 00000000..10ca392a
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/dsechs.c
@@ -0,0 +1,10 @@
+#include <math.h>
+#include "sech.h"
+#include "cosh.h"
+#include "cos.h"
+
+
+double dsechs(double in)
+{
+ return (1/cosh(in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c
new file mode 100644
index 00000000..1d265639
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/ssecha.c
@@ -0,0 +1,10 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c
new file mode 100644
index 00000000..f582fd79
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/ssechs.c
@@ -0,0 +1,10 @@
+#include <math.h>
+#include "sech.h"
+#include "cosh.h"
+#include "cos.h"
+
+
+float ssechs(float in)
+{
+ return (1/cosh(in));
+}
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c
new file mode 100644
index 00000000..c48f8dab
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/zsecha.c
@@ -0,0 +1,11 @@
+#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/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c
new file mode 100644
index 00000000..93c95b3f
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/sech/zsechs.c
@@ -0,0 +1,15 @@
+#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;
+}