length method
Computes the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).
Implementation
double length() {
return math.sqrt(x * x + y * y + z * z);
}
Computes the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).
double length() {
return math.sqrt(x * x + y * y + z * z);
}