code: public Vector3f orthogonalize(Vector3fc v, Vector3f dest) {
          /*
           * http://lolengine.net/blog/2013/09/21/picking-orthogonal-vector-combing-coconuts
           */
          float rx, ry, rz;
          if (Math.abs(v.x()) > Math.abs(v.z())) {
              rx = -v.y();
              ry = v.x();
              rz = 0.0f;
          } else {
              rx = 0.0f;
              ry = -v.z();
              rz = v.y();
          }
          float invLen = 1.0f / (float) Math.sqrt(rx * rx + ry * ry + rz * rz);
          dest.x = rx * invLen;
          dest.y = ry * invLen;
          dest.z = rz * invLen;
          return dest;
      }
docs: /* (non-Javadoc)
  @see org.joml.Vector3fc#orthogonalize(org.joml.Vector3fc, org.joml.Vector3f)