added distance to Pos3
This commit is contained in:
parent
14f7b6c6df
commit
ba05ff7645
@ -104,4 +104,8 @@ abstract Pos3(Vec3<Float>) from Vec3<Float> to Vec3<Float>{
|
|||||||
z: Math.fround(this.z)
|
z: Math.fround(this.z)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function distance(rhs:Pos3):Float {
|
||||||
|
return Math.sqrt(Math.pow(this.x - rhs.x, 2) + Math.pow(this.y - rhs.y, 2) + Math.pow(this.z - rhs.z, 2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user