00001 package commandline.baseMeshGeneration.delaunaypackage; 00002 00003 /* 00004 * Point class. RealPoint to avoid clash with java.awt.Point. 00005 */ 00006 public class RealPoint { 00007 float x, y; 00008 00009 int eI=Triangulation.Undefined; 00010 private int kleur=RealPoint.UNDEFINED; 00011 public static final int UNDEFINED=0; 00012 public static final int ROOD=1; 00013 public static final int GROEN=2; 00014 public static final int BLAUW=3; 00015 00016 RealPoint() { x = y = 0.0f; } 00017 00018 public RealPoint(float x, float y) { this.x = x; this.y = y; } 00019 00020 RealPoint(RealPoint p) { x = p.x; y = p.y; } 00021 public float x() { return this.x; } 00022 public float y() { return this.y; } 00023 public void set(float x, float y) { this.x = x; this.y = y; } 00024 00025 00030 public void setEdge_index(int eI){ 00031 this.eI=eI; 00032 } 00033 00034 00035 public float distance(RealPoint p) { 00036 float dx, dy; 00037 00038 dx = p.x - x; 00039 dy = p.y - y; 00040 return (float)Math.sqrt((double)(dx * dx + dy * dy)); 00041 } 00042 00043 public float distanceSq(RealPoint p) { 00044 float dx, dy; 00045 00046 dx = p.x - x; 00047 dy = p.y - y; 00048 return (float)(dx * dx + dy * dy); 00049 } 00050 00051 public int getKleur() { 00052 return kleur; 00053 } 00054 00055 public void setKleur(int kleur) { 00056 this.kleur = kleur; 00057 } 00058 }
1.5.5