public static boolean isRayOriginatingInSphere(Vect3 rayOrigin, Vect3 rayDirection, Vect3 sphereCenter, double sphereRadius){
Vect3 tmp = new Vect3();
Vect.subtract(sphereCenter, rayOrigin, tmp);
return tmp.quadLength()<sphereRadius*sphereRadius;
}
}