-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVector.hpp
More file actions
41 lines (37 loc) · 1.01 KB
/
Copy pathVector.hpp
File metadata and controls
41 lines (37 loc) · 1.01 KB
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
39
40
41
#ifndef VECTOR_HPP
# define VECTOR_HPP
# include <string>
# include <sstream>
# include <iostream>
# include <cmath>
# include "Vertex.hpp"
class Vector
{
public:
Vector( void );
Vector( Vertex const & dest );
Vector( Vertex const & ori, Vertex const & dest);
Vector( double const x, double const y, double const z );
Vector(Vector const & src);
~Vector( void );
Vector operator-() const;
Vector operator-(Vector const & rhs) const;
Vector operator+(Vector const & rhs) const;
double operator*(Vector const & rhs) const;
Vector operator*(double const k) const;
Vector operator^(Vector const & rhs) const;
Vector & operator=(Vector const & rhs);
double getX() const;
double getY() const;
double getZ() const;
double magnitude() const;
Vector normalize() const;
double cos(Vector const & rhs) const;
std::string toString() const;
private:
double _x;
double _y;
double _z;
};
std::ostream & operator<<(std::ostream & o, Vector const & rhs);
#endif /* VECTOR_HPP */