Dot product. @param p the other Pnt @return dot product of this Pnt and p
(Pnt p)
| 433 | * @return dot product of this Pnt and p |
| 434 | */ |
| 435 | public double dot(Pnt p) { |
| 436 | int len = dimCheck(p); |
| 437 | double sum = 0; |
| 438 | for (int i = 0; i < len; i++) |
| 439 | sum += this.coordinates[i] * p.coordinates[i]; |
| 440 | return sum; |
| 441 | } |
| 442 | |
| 443 | /** |
| 444 | * Magnitude (as a vector). |