-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrientation.h
46 lines (37 loc) · 994 Bytes
/
Orientation.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
34
35
36
37
38
39
40
41
42
43
44
45
46
// A combined position and facing angle. The angle is the counterclockwise
// angle from east "axis".
//
// Author: Michael DiBernardo
//
// REFERENCES:
// None
#ifndef __ORIENTATION_H__
#define __ORIENTATION_H__
class Orientation {
public:
// Constructs an orientation at 0,0 facing east.
Orientation();
// Constructs an orientation with the given init values.
Orientation(double initX, double initY, double angle);
// Copy constructor.
Orientation(const Orientation& o);
// Frees resources used by this object.
~Orientation();
double getX() const;
double getY() const;
double getAngle() const;
void setX(double newX);
void setY(double newY);
void setAngle(double newAngle);
void addToX(double increment);
void addToY(double increment);
void addToAngle(double increment);
private:
// My x coordinate.
double myX_;
// My y coordinate.
double myY_;
// Angle from the east axis (just like in trig class :)
double myAngle_;
};
#endif