oceanutil.h

来自「基于FFT的海面模拟。能够实现海面的复制」· C头文件 代码 · 共 50 行

H
50
字号
#ifndef OCEANUTIL_H
#define OCEANUTIL_H

#include<math.h>
#include <stdlib.h>


typedef struct 
{
	double real;
	double imag;
}oceanComplex;

typedef struct
{
	union {
		double x;
		double u;
		double r;
	};
	union {
		double y;
		double v;
		double g;
	};
	union {
		double z;
		double w;
		double b;
	};
}oceanVector;

#define  worldGravity  9.81f
const double maxHeight = 200.0f;

float ranf();
void ouGauss(double work[2]);
double ouPhillips(double a,double k[2],double wind[2]);

void   ouNormalize(double vec[]);
void   ouCrossProd(double in1[],double in2[],double out[3]);

bool    ouPowerof2(int,int *,int *);
int    ouFFT(int dir,int m,double *x,double *y);

int ouFFT2D(oceanComplex c[][512],int nx,int ny,int dir);

float	ouNeg1Pow(int k);

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?