-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVector.hpp
More file actions
38 lines (30 loc) · 900 Bytes
/
Vector.hpp
File metadata and controls
38 lines (30 loc) · 900 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
32
33
34
35
36
37
38
#ifndef VECTOR_H
#define VECTOR_H
class Vector
{
public:
//all its prototype methods, including operator overloading.
Vector(void);
Vector(double x, double y, double z);
void set(double x, double y, double z);
double dot(Vector v);
void normalize(void);
Vector add(Vector v);
Vector operator+(Vector v);
Vector subtract(Vector v);
Vector operator-(Vector v);
Vector mult(Vector v);
Vector operator*(Vector v);
Vector scal_mult(double s);
Vector operator*(double s);
Vector scal_divide(double s);
Vector operator/(double s);
double sum_components(void);
double length(void);
private:
//private variables x,y,z for its direction & magnitude.
double x;
double y;
double z;
};
#endif // VECTOR_H