Class JavaPoint3D
- java.lang.Object
-
- science.aist.imaging.api.domain.AbstractJavaPoint<JavaPoint3D>
-
- science.aist.imaging.api.domain.threedimensional.JavaPoint3D
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
NormalJavaPoint3D
public class JavaPoint3D extends AbstractJavaPoint<JavaPoint3D>
Java Representation of a 3D - point.
- Since:
- 1.0
- Author:
- Christoph Praschl
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class science.aist.imaging.api.domain.AbstractJavaPoint
x, y, z
-
-
Constructor Summary
Constructors Constructor Description JavaPoint3D(double x, double y)
JavaPoint3D(double x, double y, double z)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaPoint3D
add(JavaPoint3D vector)
Adds the given JavaPoint to this.protected JavaPoint3D
calculateUnify()
JavaPoint3D
crossProduct(JavaPoint3D b)
JavaPoint3D
div(double scalar)
Divides this by the given scalar.double
dot(JavaPoint3D vector)
Computes the dot product of this and the given JavaPoint.JavaPoint3D
mult(double scalar)
Multiplies this by the given scalar.JavaPoint3D
mult(JavaPoint3D vector)
Multiplies this by the given vector.JavaPoint3D
rotate(double roll, double pitch, double yaw)
Rotates the point around the origin (0,0,0)JavaPoint3D
rotate(JavaPoint3D origin, double roll, double pitch, double yaw)
Rotates the point around the given originJavaPoint3D
sub(JavaPoint3D vector)
Subtracts the given JavaPoint from this.-
Methods inherited from class science.aist.imaging.api.domain.AbstractJavaPoint
equals, equals, getIntX, getIntY, getIntZ, hashCode, pointDistance, positionalEqual, positionalEqual, xDistance, yDistance, zDistance
-
-
-
-
Method Detail
-
sub
public JavaPoint3D sub(JavaPoint3D vector)
Subtracts the given JavaPoint from this.- Specified by:
sub
in classAbstractJavaPoint<JavaPoint3D>
- Parameters:
vector
- The JavaPoint to be subtracted from this- Returns:
- A new instance holding the result of the vector subtraction
-
add
public JavaPoint3D add(JavaPoint3D vector)
Adds the given JavaPoint to this.- Specified by:
add
in classAbstractJavaPoint<JavaPoint3D>
- Parameters:
vector
- The JavaPoint to be added to this- Returns:
- A new instance holding the result of the vector addition
-
mult
public JavaPoint3D mult(double scalar)
Multiplies this by the given scalar.- Specified by:
mult
in classAbstractJavaPoint<JavaPoint3D>
- Parameters:
scalar
- The scalar to be multiplied by this- Returns:
- A new instance holding the result of the multiplication
-
mult
public JavaPoint3D mult(JavaPoint3D vector)
Multiplies this by the given vector.- Specified by:
mult
in classAbstractJavaPoint<JavaPoint3D>
- Parameters:
vector
- The vector to be multiplied by this- Returns:
- A new instance holding the result of the multiplication
-
div
public JavaPoint3D div(double scalar)
Divides this by the given scalar.- Specified by:
div
in classAbstractJavaPoint<JavaPoint3D>
- Parameters:
scalar
- The scalar to by which this should be divided- Returns:
- A new instance holding the result of the division
-
calculateUnify
protected JavaPoint3D calculateUnify()
- Specified by:
calculateUnify
in classAbstractJavaPoint<JavaPoint3D>
- Returns:
- Returns a new instance holding the unit vector of this
-
dot
public double dot(JavaPoint3D vector)
Computes the dot product of this and the given JavaPoint.- Specified by:
dot
in classAbstractJavaPoint<JavaPoint3D>
- Parameters:
vector
- The JavaPoint to be multiplied by this- Returns:
- A new instance holding the result of the multiplication
-
rotate
public JavaPoint3D rotate(double roll, double pitch, double yaw)
Rotates the point around the origin (0,0,0)- Parameters:
roll
- Rotation around x-axis (in degrees)pitch
- Rotation around y-axis (in degrees)yaw
- Rotation around z-axis (in degrees)- Returns:
- Returns a new, rotated instance
-
crossProduct
public JavaPoint3D crossProduct(JavaPoint3D b)
- Parameters:
b
- the second vector- Returns:
- the cross product c = a x b, where a == this
-
rotate
public JavaPoint3D rotate(JavaPoint3D origin, double roll, double pitch, double yaw)
Rotates the point around the given origin- Parameters:
origin
- origin point around which will be rotated.roll
- Rotation around x-axis (in degrees)pitch
- Rotation around y-axis (in degrees)yaw
- Rotation around z-axis (in degrees)- Returns:
- Returns a new, rotated instance
-
-