-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCCommon.h
20 lines (18 loc) · 911 Bytes
/
CCommon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//////////////////////////////////////////////////////////
// Common.h
//--------------------------------------------------------
// Common algorithms for general uses.
//
// Abin ([email protected])
//////////////////////////////////////////////////////////
#include <windows.h>
long CalculateDistance(const POINT& pt1, const POINT& pt2);
long CalculateDistance(long x1, long y1, long x2, long y2);
long CalculateAngle(const POINT& pt1, const POINT& pt2);
long CalculateAngle(long x1, long y1, long x2, long y2);
void NormalizeAngle(int& rAngle);
void NormalizeRect(RECT& rRect);
void NormalizeRect(LPRECT lpRect);
POINT CalculatePointOnTrack(const POINT& ptOrigin, int nRadius, int nAngle);
POINT CalculateRandomPosition(const POINT& ptOrigin, int nRadiusMin, int nRadiusMax, int nAngleMin = 0, int nAngleMax = 360);
BOOL PtInCircle(const POINT& pt, const POINT& ptOrigin, int nRadius);