forked from ChrisMayfield/ThinkJavaCode2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPose.java
More file actions
34 lines (29 loc) · 710 Bytes
/
Pose.java
File metadata and controls
34 lines (29 loc) · 710 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
/**
* A point with an associated heading (in degrees).
*/
public class Pose extends Point {
private final double heading;
/**
* Constructs a pose at the given location.
*
* @param x the X coordinate
* @param y the Y coordinate
* @param heading the heading
*/
public Pose(double x, double y, double heading) {
super(x, y);
this.heading = heading;
}
/**
* @return heading the heading
*/
public double getHeading() {
return heading;
}
/**
* @return string representation of the pose
*/
public String toString() {
return String.format("%s @%.1f", super.toString(), this.heading);
}
}