Gets the magnitude of the vector, defined as sqrt(x^2+y^2+z^2). The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the vector's magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be
()
| 167 | * @return the magnitude |
| 168 | */ |
| 169 | public double length() { |
| 170 | return Math.sqrt(NumberConversions.square(x) + NumberConversions.square(y) + NumberConversions.square(z)); |
| 171 | } |
| 172 | |
| 173 | /** |
| 174 | * Gets the magnitude of the vector squared. |
no test coverage detected