From afae3013c86d26dc1b233228431be208705acff0 Mon Sep 17 00:00:00 2001 From: Ankitr19 Date: Tue, 4 Jul 2017 15:26:35 +0530 Subject: New function and rpi issues resolved --- src/c/signalProcessing/amell/damells.c | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/c/signalProcessing/amell/damells.c (limited to 'src/c/signalProcessing/amell/damells.c') diff --git a/src/c/signalProcessing/amell/damells.c b/src/c/signalProcessing/amell/damells.c new file mode 100644 index 00000000..90c20530 --- /dev/null +++ b/src/c/signalProcessing/amell/damells.c @@ -0,0 +1,57 @@ +/* Copyright (C) 2017 - 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: Ankit Raj + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ + +#include +#include +#include "amell.h" +#define N 30 +#define DBL_EPSILON 2.2204460492503131E-16 + + +double damells(double u,double x) +{ + double a[N+1]; + double g[N+1]; + double c[N+1]; + double two_n; + double phi; + double k; + int n; + k=(long double)fabs(x); + if(k==1.0) + return 0; + if(k>1.0) + printf("Wrong type of input argument type #2"); + + a[0]=1.0; + g[0]=sqrt(1.0-k*k); + c[0]=k; + two_n=1.0; + for(n=0;n0;n--) + { + phi=0.5*(phi+asin(c[n]*sin(phi)/a[n])); + } + return (double)phi; +} + -- cgit