Interface IVector3D
-
Method Summary
Modifier and TypeMethodDescriptionceil()Returns a new vector withMath.ceil(double)applied to the current values.floor()Returns a new vector withMath.floor(double)applied to the current values.default doublegetDistance(ILocation location) Gets the distance to a location.default doublegetDistance(IVector3D point) Gets the distance to a point.default doubleReturns the magnitude of this vector.round()Returns a new vector withMath.round(double)applied to the current values.default Vector3DdConverts all the values in this 3d vector to degrees.toDouble()Creates a new double-based 3d vector from this integer-based 3d vector.Creates a new integer-based 3d vector from this 3d vector.default ILocationtoLocation(ILocationFactory locationFactory, IWorld world) Creates a newILocationusing the current x/y/z coordinates.default Vector3DdConverts all the values in this 3d vector to tadians.doublexD()Returns the x value as double.doubleyD()Returns the y value as double.doublezD()Returns the z value as double.
-
Method Details
-
xD
@CheckReturnValue @Contract(pure=true) double xD()Returns the x value as double.- Returns:
- The x value as double.
-
yD
@CheckReturnValue @Contract(pure=true) double yD()Returns the y value as double.- Returns:
- The y value as double.
-
zD
@CheckReturnValue @Contract(pure=true) double zD()Returns the z value as double.- Returns:
- The z value as double.
-
getDistance
Gets the distance to a point.- Parameters:
point- The point.- Returns:
- The distance to the other point.
-
getDistance
Gets the distance to a location.- Parameters:
location- The location.- Returns:
- The distance to the other point.
-
toLocation
-
magnitude
@CheckReturnValue @Contract(pure=true) default double magnitude()Returns the magnitude of this vector.- Returns:
- The magnitude of this vector.
-
floor
IVector3D floor()Returns a new vector withMath.floor(double)applied to the current values.- Returns:
- A new vector with
Math.floor(double)applied to the current values.
-
round
IVector3D round()Returns a new vector withMath.round(double)applied to the current values.- Returns:
- A new vector with
Math.round(double)applied to the current values.
-
ceil
IVector3D ceil()Returns a new vector withMath.ceil(double)applied to the current values.- Returns:
- A new vector with
Math.ceil(double)applied to the current values.
-
toRadians
Converts all the values in this 3d vector to tadians.- Returns:
- The new 3d vector.
-
toDegrees
Converts all the values in this 3d vector to degrees.- Returns:
- The new 3d vector.
-
toInteger
Creates a new integer-based 3d vector from this 3d vector.The values of a double-based vector will be rounded to obtain the integer values.
- Returns:
- A new integer-based vector.
-
toDouble
Creates a new double-based 3d vector from this integer-based 3d vector.- Returns:
- A new double-based vector.
-