-
Notifications
You must be signed in to change notification settings - Fork 8
/
Point3D.h
33 lines (28 loc) · 1.07 KB
/
Point3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
class CPoint3D
{
public:
float x, y, z;
CPoint3D ( ); // normal constructor
CPoint3D ( const CPoint3D &v ); // normal constructor
CPoint3D ( int, int, int ); // normal constructor
CPoint3D ( float, float, float ); // normal constructor
CPoint3D ( double, double, double );// normal constructor
~CPoint3D ();
// arithmetic operations
const CPoint3D& operator += ( const CPoint3D& v);
const CPoint3D& operator -= ( const CPoint3D& v);
float operator & ( const CPoint3D& v ); // doc_product
CPoint3D operator + ( const CPoint3D& v );
CPoint3D operator - ( const CPoint3D& v );
CPoint3D operator * ( const CPoint3D& v ); // cross_product
CPoint3D operator * ( int k ); // scale by int
CPoint3D operator * ( float k ); // scale by float
CPoint3D operator * ( double k ); // scale by double
// int operator = ( CPoint3D& v );
void unify();
void RangeUnify(float min,float max);
float length();
//把自己投影到新的坐标系中间
CPoint3D ProjectToNewCoordinate(CPoint3D& coordX,CPoint3D& coordY,CPoint3D& coordZ);
};