Questo commit è contenuto in:
Lacroix Raphael 2022-03-25 17:17:22 +01:00
parent ca806aafff
commit 1f6999aefc

Vedi file

@ -210,11 +210,14 @@ public class Path {
* *
* @return Total length of the path (in meters). * @return Total length of the path (in meters).
* *
* @deprecated Need to be implemented.
*/ */
public float getLength() { public float getLength() {
// TODO: float acc = 0;
return 0; for (Arc l : arcs) {
acc += l.getLength();
}
return acc;
} }
/** /**
@ -225,10 +228,10 @@ public class Path {
* @return Time (in seconds) required to travel this path at the given speed (in * @return Time (in seconds) required to travel this path at the given speed (in
* kilometers-per-hour). * kilometers-per-hour).
* *
* @deprecated Need to be implemented.
*/ */
public double getTravelTime(double speed) { public double getTravelTime(double speed) {
return (this.getLength()/speed); double speed2 = speed * 1000/3600;
return (this.getLength()/speed2);
} }
/** /**