Computes the distance between this point and point p1. @param p1 the other point @return the distance between the two points
(Point4f p1)
| 153 | * @return the distance between the two points |
| 154 | */ |
| 155 | public final float distance(Point4f p1) { |
| 156 | float dx, dy, dz, dw; |
| 157 | |
| 158 | dx = this.x - p1.x; |
| 159 | dy = this.y - p1.y; |
| 160 | dz = this.z - p1.z; |
| 161 | dw = this.w - p1.w; |
| 162 | return (float) Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw); |
| 163 | } |
| 164 | |
| 165 | |
| 166 | /** |