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