diff options
author | Siddhesh Wani | 2017-05-04 16:15:18 +0530 |
---|---|---|
committer | Siddhesh Wani | 2017-05-04 16:15:18 +0530 |
commit | de82d12658979cd70439f977742f80fac9f6521f (patch) | |
tree | eff661402e749b2402f5576271aefddd42be23fe /2.3-1/src/c/elementaryFunctions/Trigonometry/cotd | |
parent | 472b2e7ebbd2d8b3ecd00b228128aa8a0bd3f920 (diff) | |
download | Scilab2C-de82d12658979cd70439f977742f80fac9f6521f.tar.gz Scilab2C-de82d12658979cd70439f977742f80fac9f6521f.tar.bz2 Scilab2C-de82d12658979cd70439f977742f80fac9f6521f.zip |
Basic functions and image processing working with MSVC on windows x64
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/Trigonometry/cotd')
4 files changed, 57 insertions, 9 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c index 3cf032a1..3a4b23c1 100644 --- a/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotda.c @@ -1,16 +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 "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]);*/ + out[i]=dcotds(in[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 index 4ba95b84..34befb62 100644 --- a/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/dcotds.c @@ -1,9 +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 +*/ + +#ifdef _WIN32 + #define _USE_MATH_DEFINES +#endif + #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 index fd5a1e11..fbdf0f50 100644 --- a/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotda.c @@ -1,9 +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 "cotd.h" void scotda(float* in, int size, float* out) { int i = 0; for (i = 0; i < size; ++i) { - out[i] = scosds(in[i]); + out[i] = scotds(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 index d635dbcd..e7e02b9d 100644 --- a/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cotd/scotds.c @@ -1,3 +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 +*/ + +#ifdef _WIN32 + #define _USE_MATH_DEFINES +#endif + #include <math.h> #include "cotd.h" |