1 19 package jcckit.util; 20 21 27 public class Point { 28 private final double _x; 29 private final double _y; 30 31 37 public Point(double[] vector) { 38 double x = 0; 39 double y = 0; 40 if (vector != null && vector.length > 0) { 41 x = vector[0]; 42 if (vector.length > 1) { 43 y = vector[1]; 44 } 45 } 46 _x = x; 47 _y = y; 48 } 49 50 51 public Point(double x, double y) { 52 _x = x; 53 _y = y; 54 } 55 56 57 public double getX() { 58 return _x; 59 } 60 61 62 public double getY() { 63 return _y; 64 } 65 } 66 | Popular Tags |