comparison flys-backend/src/main/java/org/dive4elements/river/importer/parsers/tim/Coordinate.java @ 5828:dfb26b03b179

Moved directories to org.dive4elements.river
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 11:53:11 +0200
parents flys-backend/src/main/java/de/intevation/flys/importer/parsers/tim/Coordinate.java@99f9e371371b
children 18619c1e7c2a
comparison
equal deleted inserted replaced
5827:e308d4ecd35a 5828:dfb26b03b179
1 package de.intevation.flys.importer.parsers.tim;
2
3 /** X,Y,Z- triple. */
4 public class Coordinate
5 {
6 public double x;
7 public double y;
8 public double z;
9
10 public Coordinate() {
11 }
12
13 public Coordinate(Coordinate c) {
14 this(c.x, c.y, c.z);
15 }
16
17 public Coordinate(double x, double y) {
18 this(x, y, 0d);
19 }
20
21 public Coordinate(double x, double y, double z) {
22 this.x = x;
23 this.y = y;
24 this.z = z;
25 }
26
27 public double getX() {
28 return this.x;
29 }
30
31 public double getY() {
32 return this.y;
33 }
34
35 public final double distanceSqr(double ox, double oy) {
36 double dx = x - ox;
37 double dy = y - oy;
38 return dx*dx + dy*dy;
39 }
40
41 public final double distance(double xo, double yo) {
42 return Math.sqrt(distanceSqr(xo, yo));
43 }
44 }
45 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org