-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv3.h
More file actions
31 lines (29 loc) · 884 Bytes
/
Copy pathv3.h
File metadata and controls
31 lines (29 loc) · 884 Bytes
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
#ifndef _V3_H
#define _V3_H
#include <math.h>
class v3
{
private:
double v[3];
public:
v3(double a =0,double b =0, double c=0);
~v3();
v3(const v3& rhs); //Copy Constructor
v3 & operator=(const v3 & rhs); //assignment operator
v3 operator +(const v3 & rhs); // sum operator
const v3 operator +(const v3 & rhs) const; // sum operator
v3 operator -( const v3 & rhs); // subtract operator
const v3 operator -( const v3 & rhs) const; // subtract operator
v3 operator /(double a) ; // divide operator
v3 operator * (double a);
v3 & operator-=(const v3 & rhs);
double dot(const v3 & rhs) const; // dot product
v3 cross(const v3 & rhs); // cross product
double length(const v3 & x , const v3 &y);
double length();
double getX() const;
double getY() const;
double getZ() const;
// void tranform(glm::mat4 &mat);
};
#endif