00001 package commandline.ImageStuff;
00002
00003
00004 import commandline.debuggingCode.Debug;
00005
00006
00007
00008 public class Pixel extends Loc{
00009
00010 private float z;
00011
00012 public Pixel(int x, int y, float z) {
00013 super(x, y);
00014 setZ(z);
00015 }
00016
00022 public float afstand_3d(Pixel a) {
00023 return (float)Math.sqrt((Math.pow(getX() - a.getX(), 2)
00024 + Math.pow(getY() - a.getY(), 2) + Math.pow(getZ() - a.getZ(),
00025 2)));
00026
00027 }
00028
00029 public Loc getLoc(){
00030 return (Loc) this;
00031 }
00032
00033 public float getZ() {
00034 return z;
00035 }
00036
00037 public void setZ(float z) {
00038 this.z = z;
00039 }
00040
00041 public void print() {
00042 Debug.print("(" + getX() + "," + getY() + "," + getZ() + ")");
00043 }
00044
00045 public Pixel getCopy() {
00046 Pixel p = new Pixel(this.x, this.y, this.z);
00047
00048 return p;
00049 }
00050
00051 public String getPrintValue() {
00052 return "" + this.getX() + " " + this.getY() + " " + this.getZ();
00053
00054 }
00055
00056 }