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

📄 pnt.h

📁 这是书上的代码
💻 H
字号:
// Pnt.h: interface for the CPnt class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PNT_H__CC7F6781_4385_11D4_A4DD_00D0B7213322__INCLUDED_)
#define AFX_PNT_H__CC7F6781_4385_11D4_A4DD_00D0B7213322__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CPnt 
{
public:
	double x;        // X coordinates
	double y;        // Y coordinates
	// The constructor
	CPnt(double fx, double fy)
	{
		x = fx;
		y = fy;
	}

	// Default constructor
	CPnt() {}
	virtual ~CPnt();	
	// Copy constructor
	void operator =(CPnt pnt);	
	// Test if 2 objects are identical
	BOOL operator ==(CPnt& pt);
	friend CArchive& operator >> (CArchive& ar, CPnt& Obj);
	friend CArchive& operator << (CArchive& ar, CPnt& Obj);
protected:
//	DECLARE_DYNAMIC(CPnt)

};


//////////////////////////////////////////////////////////////////////////////
//   The interface of class "CAngle".
enum ANGLE_MODE {IN_RADIAN, IN_DEGREE};

class CAngle
{
private:
	static double m_fReso;        // Resolution for angle computation

public:
	double m_fRad;                // The angle value in radian

public:
	// Convert degree into radian
	static double ToRadian(double deg);

	// Convert radian into degree
	static double ToDegree(double rad);

	// Normalize an angle
	static double NormAngle(double rad);

	// Set new resolution for angle computation
	static double SetReso(double fReso);

public:
	// The constructors
	CAngle(double val, int mode = IN_RADIAN);

	// The default constructor
	CAngle() {}

	// Get the angle value in "degree"
	double Degree();

	// The quadrant of angle: 1/2/3/4
	int Quadrant();

	// Overloaded operators: "!", "+", "-", "+=", "-=", "==", ">", "<"
	CAngle operator -();
	CAngle operator !();
	CAngle operator +(const CAngle& Ang);
	CAngle operator -(const CAngle& Ang);
	void operator +=(const CAngle& Ang);
	void operator -=(const CAngle& Ang);
	BOOL operator ==(const CAngle& Ang);
	BOOL operator !=(const CAngle& Ang);
	BOOL operator >(const CAngle& Ang);
	BOOL operator <(const CAngle& Ang);
	BOOL operator >=(const CAngle& Ang);
	BOOL operator <=(const CAngle& Ang);

};

#endif // !defined(AFX_PNT_H__CC7F6781_4385_11D4_A4DD_00D0B7213322__INCLUDED_)

⌨️ 快捷键说明

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