git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made the track serializable.
[utils]
/
gps
/
src
/
org
/
wamblee
/
gps
/
geometry
/
Coordinates.java
diff --git
a/gps/src/org/wamblee/gps/geometry/Coordinates.java
b/gps/src/org/wamblee/gps/geometry/Coordinates.java
index 544c92a1f405cd7ff376a26511228b52330b82f3..4a9b820d3a7d1caabe5edca5c26f5b62aca884ce 100644
(file)
--- a/
gps/src/org/wamblee/gps/geometry/Coordinates.java
+++ b/
gps/src/org/wamblee/gps/geometry/Coordinates.java
@@
-16,10
+16,12
@@
package org.wamblee.gps.geometry;
package org.wamblee.gps.geometry;
+import java.io.Serializable;
+
/**
* Coordinates in some 3-dimensional coordinate system.
*/
/**
* Coordinates in some 3-dimensional coordinate system.
*/
-public class Coordinates {
+public class Coordinates
implements Serializable
{
private double _x1;
private double _x2;
private double _x1;
private double _x2;
@@
-49,6
+51,15
@@
public class Coordinates {
return _x3;
}
return _x3;
}
+ public double getX(int i) {
+ switch (i) {
+ case 1: return _x1;
+ case 2: return _x2;
+ case 3: return _x3;
+ }
+ throw new IllegalArgumentException("coordinate out of range " + i);
+ }
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/