📄 point2f.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 + -