Class Quaternion4D
java.lang.Object
com.io7m.jtensors.core.quaternions.Quaternion4D
- All Implemented Interfaces:
Quaternion4DType, QuaternionReadable4DType
The type of 4D
double-typed quaternions.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Quaternion4D.Builderbuilder()Creates a builder forQuaternion4D.static Quaternion4DcopyOf(Quaternion4DType instance) Creates an immutable copy of aQuaternion4DTypevalue.booleanThis instance is equal to all instances ofQuaternion4Dthat have equal attribute values.inthashCode()Computes a hash code from attributes:x,y,z,w.static Quaternion4Dof(double x, double y, double z, double w) Construct a new immutableQuaternion4Dinstance.toString()Prints the immutable valueQuaternion4Dwith attribute values.doublew()final Quaternion4DwithW(double value) Copy the current immutable object by setting a value for thewattribute.final Quaternion4DwithX(double value) Copy the current immutable object by setting a value for thexattribute.final Quaternion4DwithY(double value) Copy the current immutable object by setting a value for theyattribute.final Quaternion4DwithZ(double value) Copy the current immutable object by setting a value for thezattribute.doublex()doubley()doublez()
-
Method Details
-
x
public double x()- Specified by:
xin interfaceQuaternion4DType- Specified by:
xin interfaceQuaternionReadable4DType- Returns:
- The value of the
xattribute
-
y
public double y()- Specified by:
yin interfaceQuaternion4DType- Specified by:
yin interfaceQuaternionReadable4DType- Returns:
- The value of the
yattribute
-
z
public double z()- Specified by:
zin interfaceQuaternion4DType- Specified by:
zin interfaceQuaternionReadable4DType- Returns:
- The value of the
zattribute
-
w
public double w()- Specified by:
win interfaceQuaternion4DType- Specified by:
win interfaceQuaternionReadable4DType- Returns:
- The value of the
wattribute
-
withX
Copy the current immutable object by setting a value for thexattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for x- Returns:
- A modified copy or the
thisobject
-
withY
Copy the current immutable object by setting a value for theyattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for y- Returns:
- A modified copy or the
thisobject
-
withZ
Copy the current immutable object by setting a value for thezattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for z- Returns:
- A modified copy or the
thisobject
-
withW
Copy the current immutable object by setting a value for thewattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for w- Returns:
- A modified copy or the
thisobject
-
equals
-
hashCode
-
toString
-
of
Construct a new immutableQuaternion4Dinstance.- Parameters:
x- The value for thexattributey- The value for theyattributez- The value for thezattributew- The value for thewattribute- Returns:
- An immutable Quaternion4D instance
-
copyOf
Creates an immutable copy of aQuaternion4DTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Quaternion4D instance
-
builder
Creates a builder forQuaternion4D.Quaternion4D.builder() .setX(double) // required
x.setY(double) // requiredy.setZ(double) // requiredz.setW(double) // requiredw.build();- Returns:
- A new Quaternion4D builder
-