Returns whether this vector is within a sphere. @param origin Sphere origin. @param radius Sphere radius @return whether this vector is in the sphere
(@NotNull Vector origin, double radius)
| 400 | * @return whether this vector is in the sphere |
| 401 | */ |
| 402 | public boolean isInSphere(@NotNull Vector origin, double radius) { |
| 403 | return (NumberConversions.square(origin.x - x) + NumberConversions.square(origin.y - y) + NumberConversions.square(origin.z - z)) <= NumberConversions.square(radius); |
| 404 | } |
| 405 | |
| 406 | /** |
| 407 | * Returns if a vector is normalized |