length method

double length()

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);
}