⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 condation.cpp

📁 海洋油污扩散模型的计算机实现。简单了点
💻 CPP
字号:
// Condation.cpp: implementation of the CCondation class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Pollution.h"
#include "Condation.h"
#include "math.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CCondation::CCondation()
{

    fWind=5;
	m_fScale=0.1;
	m_fEarthRotSpeed=0.1;
	m_fWaterDepth=11;
	m_fWaterSlope=0.1;
	m_fWaterWidth=100;


}

CCondation::~CCondation()
{

}
int CCondation::GetStation(int nSun,float fWind)
{
    
	if(nSun==5&&fWind<2||nSun==4&&fWind<2||nSun==5&&(fWind<3&&fWind>2))
		nAirStation=1;
	else if(nSun==4&&(fWind<3&&fWind>2)||nSun==3&&fWind<2||nSun==1&&(fWind<5&&fWind>3)||nSun==4&&(fWind<5&&fWind>3))
        nAirStation=2;
	else if(nSun==3&&(fWind<3&&fWind>2)||nSun==3&&(fWind<5&&fWind>3)||nSun==5&&(fWind<6&&fWind>5)||nSun==4&&(fWind<6&&fWind>5)||nSun==5&&fWind>6)
        nAirStation=3;
	else if(nSun<3&&fWind<2)
		nAirStation=0;
	else if(nSun==2&&fWind<3&&fWind>2)
		nAirStation=5;
	else if(nSun==1&&fWind<3&&fWind>2)
		nAirStation=6;
	else nAirStation=4;
	return nAirStation;
}
float CCondation::GetWideY(int nAirStation,int x)
{
   float fWideYTemp;
	switch(nAirStation)
	{
	case 1:
		fWideYTemp=0.22*x/sqrt(1+0.001*x);
		return fWideYTemp;
		//break;
	case 2:
		fWideYTemp=0.16*x/sqrt(1+0.001*x);
		return fWideYTemp;
		//break;
	case 3:
		fWideYTemp=0.11*x/sqrt(1+0.001*x);
		return fWideYTemp;
		//break;
	case 4:
		fWideYTemp=0.08*x/sqrt(1+0.001*x);
		return fWideYTemp;
		//break;
	case 5:
		fWideYTemp=0.06*x/sqrt(1+0.001*x);
		return fWideYTemp;
		//break;
	case 6:
		fWideYTemp=0.04*x/sqrt(1+0.001*x);
		return fWideYTemp;
		//break;
	}

}
float CCondation::GetWideZ(int nAirStation,int x)
{
   float fWideZTemp;
	switch(nAirStation)
	{
	case 1:
		fWideZTemp=0.22*x;
		return fWideZTemp;
		//break;
	case 2:
		fWideZTemp=0.12*x;
		return fWideZTemp;
		//break;
	case 3:
		fWideZTemp=0.08*x/sqrt(1+0.0015*x);
		return fWideZTemp;
		//break;
	case 4:
		fWideZTemp=0.06*x/sqrt(1+0.0015*x);
		return fWideZTemp;
		//break;
	case 5:
		fWideZTemp=0.03*x/sqrt(1+0.003*x);
		return fWideZTemp;
		//break;
	case 6:
		fWideZTemp=0.016*x/sqrt(1+0.003*x);
		return fWideZTemp;
		//break;
	}

}

⌨️ 快捷键说明

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