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

📄 point2f.cpp

📁 一个激光谐振腔的稳态过程模拟程序。通过设置波长
💻 CPP
字号:
// POINT2F.cpp: implementation of the POINT2F class.
//
//////////////////////////////////////////////////////////////////////

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

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

POINT2F::POINT2F()
{
	x=0;
	A=1;
	P=0;
	Re=1;
	Im=0;
}

POINT2F::~POINT2F()
{

}

float POINT2F::GetAmplitude(float a,float b)
{
	float x;
	x=sqrt(a*a+b*b);
	return x;
}

float POINT2F::GetPhrase(float a,float b)
{
	float x;
	float aa,bb;
//	x=atan(a/b);
	if(b>0)
	{
		if(a>=0) x=atan(a/b);
		else     x=2*PI+atan(a/b);
	}
	else if(b==0)
	{
		if(a>0)	x=PI/2;
		else if(a==0) x=0;
		else x=-PI/2;
	}
	else if(a>0)	x=PI+atan(a/b);
	else if(a<0)	x=-PI+atan(a/b);
	return x;
}

void POINT2F::Init_point(float a,float b,float c,float d,float e)
{
	x=a;
	Re=b;
	Im=c;
	A=d;
	P=e;
}


float POINT2F::GetRe(float R, float I)
{	
	return 0;
}

⌨️ 快捷键说明

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