refactor/style[main]: Formatting, Parameter-Names and deprecated signatures
This commit is contained in:
parent
2599d21417
commit
84aedd2e5b
13
MMS24_25.c
13
MMS24_25.c
@ -7,18 +7,16 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
double interpolateLine(double x1, double y1,double x2, double y2, double x){
|
double interpolateLine(double dX1, double dY1,double dX2, double dY2, double dXq) {
|
||||||
double y = ((y2 - y1) / (x2 - x1)) * x + y1 - ((y2 - y1) / (x2 - x1)) * x1;
|
double y = ((dY2 - dY1) / (dY2 - dX1)) * dXq + dY1 - ((dY2 - dY1) / (dX2 - dX1)) * dX1;
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rescaleDoubleArray(double *pdIn, int iLen, int iMin, double dFactor, double *pdOut){
|
void rescaleDoubleArray(double *pdIn, int iLen, double dMin, double dFactor, double *pdOut) {
|
||||||
for (int i = 0; i < iLen; i++) {
|
|
||||||
pdOut[i] = pdIn[i + iMin] * dFactor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double *generateSineValues(int iNumValues, int iNumSamplesPerPeriod, double dAmp){
|
double *generateSineValues(int iNumValues, int iNumSamplesPerPeriod, double dAmp) {
|
||||||
double* sineArray = (double*)malloc(iNumValues * sizeof(double));
|
double* sineArray = (double*)malloc(iNumValues * sizeof(double));
|
||||||
for (int i=0; i<iNumValues;i++){
|
for (int i=0; i<iNumValues;i++){
|
||||||
sineArray[i] = dAmp*sin(((2*M_PI)/iNumSamplesPerPeriod) * i);
|
sineArray[i] = dAmp*sin(((2*M_PI)/iNumSamplesPerPeriod) * i);
|
||||||
@ -38,5 +36,4 @@ void writeDoubleArray(double *pdOut, int iLen, char *pcOutName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fclose(datei);
|
fclose(datei);
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user