Package com.aidano7.bison.linearAlgebra
Class Vector3
java.lang.Object
com.aidano7.bison.linearAlgebra.Vector3
public class Vector3
extends java.lang.Object
- Since:
- 8/22/2021
- Version:
- v0.1
This is the class for a 3-dimensional vector. It has 3 components, x, y, and z.
- Author:
- aidano-7
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description float
getX()
Returns the X component of the vector.float
getY()
Returns the Y component of the vector.float
getZ()
Returns the Z component of the vector.void
setX(float x)
Sets the new X component of the vector.void
setY(float y)
Sets the new Y component of the vector.void
setZ(float z)
Sets the new Z component of the vector.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Vector3
public Vector3(float x, float y, float z)Creates instance of a vector object with given x, y, and z components.- Parameters:
x
- X component (1 dimension)y
- Y component (2 dimension)z
- Z component (3 dimension)
-
Vector3
public Vector3()Default constructor. Sets all components to 0.
-
-
Method Details
-
getX
public float getX()Returns the X component of the vector.- Returns:
- x X component
-
setX
public void setX(float x)Sets the new X component of the vector.- Parameters:
x
- new X component
-
getY
public float getY()Returns the Y component of the vector.- Returns:
- y Y component
-
setY
public void setY(float y)Sets the new Y component of the vector.- Parameters:
y
- new Y component
-
getZ
public float getZ()Returns the Z component of the vector.- Returns:
- z Z component
-
setZ
public void setZ(float z)Sets the new Z component of the vector.- Parameters:
z
- new Z component
-