forked from mikahlbk/SpatialYeastModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoord.h
More file actions
55 lines (46 loc) · 1.37 KB
/
Copy pathcoord.h
File metadata and controls
55 lines (46 loc) · 1.37 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//coord.h
//*****************************************************
#ifndef _COORD_H_INCLUDED_
#define _COORD_H_INCLUDED_
//*****************************************************
//forward dependencies
//*****************************************************
//include dependencies
#include <iostream>
using namespace std;
//*****************************************************
class Coord {
protected:
double x;
double y;
public:
//Constructors
Coord(); //default=> sets it to (0,0)
Coord(double x, double y);
Coord(const Coord& c);
//Getter Functions
double get_X() const;
double get_Y() const;
//Overloading Operators
void operator = (const Coord& c);
Coord operator+(const Coord& c) const;
Coord operator+(const double& d) const;
Coord operator-(const Coord& c) const;
Coord operator-(const double& d) const;
Coord operator/(const double& d) const;
Coord operator*(const double& d) const;
void operator+=(const Coord& c);
void operator+=(const double& d);
void operator-=(const Coord& c);
void operator-=(const double& d);
//Coord distribute(const Coord c) const;
bool operator==(const Coord& c);
bool operator!=(const Coord& c);
//Higher level math
double dot(const Coord& c) const;
double cross(const Coord& c) const;
double length() const;
//Display Functions
friend ostream& operator<<(ostream& os, const Coord& c);
};
#endif