public abstract class Abstract3d extends Object
Modifier and Type | Field and Description |
---|---|
protected double |
x |
protected double |
y |
protected double |
z |
Modifier | Constructor and Description |
---|---|
protected |
Abstract3d(double x,
double y,
double z) |
Modifier and Type | Method and Description |
---|---|
static boolean |
closeEquals(Abstract3d value1,
Abstract3d value2)
Checks a much closer equal relation than the equals method does.
|
double |
dot(Abstract3d a)
Returns the dot product of this vector and the specified vector.
|
boolean |
equals(Object obj) |
String |
format(OutputFormat outputFormat)
Formats the coordinates using the given output format.
|
double |
getX() |
double |
getY() |
double |
getZ() |
int |
hashCode() |
boolean |
isIdent()
Checks if all three coordinates are one.
|
boolean |
isXZero()
Checks if the X coordinate is zero.
|
boolean |
isYZero()
Checks if the Y coordinate is zero.
|
boolean |
isZero()
Checks if all three coordinates are zero, which means it is equals to
isXZero() && isYZero() && isZZero().
|
boolean |
isZZero()
Checks if the Z coordinate is zero.
|
double |
magnitude()
Returns the magnitude of this vector.
|
void |
toByteArray(ByteBuffer byteBuffer)
Returns the byte array representation of this object used by the binary STL export function.
|
String |
toString() |
public final boolean isXZero()
public final boolean isYZero()
public final boolean isZZero()
public final boolean isZero()
public final boolean isIdent()
public String format(OutputFormat outputFormat)
outputFormat
- the output format to be usedpublic void toByteArray(ByteBuffer byteBuffer)
byteBuffer
- the byte buffer where the coordinates will be written.public static boolean closeEquals(Abstract3d value1, Abstract3d value2)
value1
- the first value to be checkedvalue2
- the second value to be checkedpublic double getX()
public double getY()
public double getZ()
public double dot(Abstract3d a)
a
- the second vectorpublic double magnitude()
Copyright © 2014–2020, Printing in 3D. All rights reserved.