public class Point3D extends Object
Represents class to work with 3D point and special operations for it.
Constructor and Description |
---|
Point3D()
Initializes a new instance of the Point3D class
|
Point3D(com.aspose.foundation.rendering.ApsPoint apsPoint)
Initializes a new instance of the Point3D class.
|
Point3D(double x,
double y)
Initializes a new instance of the Point3D class
|
Point3D(double x,
double y,
double z)
Initializes a new instance of the Point3D class
|
Point3D(double x,
double y,
double z,
double w)
Initializes a new instance of the Point3D class
|
Modifier and Type | Method and Description |
---|---|
Point3D |
copy()
Creates copy of current point
|
static Point3D |
crossProduct(Point3D point1,
Point3D point2)
Gets cross-product of a points
|
static double |
distance(Point3D point1,
Point3D point2)
Gets distance between points
|
static double |
dotProduct(Point3D point1,
Point3D point2)
Gets dot product between two vectors.
|
boolean |
equals(Object obj)
Allows to compare 3D points.
|
boolean |
equalsSoft(Object obj) |
boolean |
equalsSoft(Object obj,
double eps)
Allows to compare 3D points with specified threshold.
|
double |
getW()
Gets or sets W coordinate
|
double |
getX()
Gets or sets X coordinate
|
double |
getY()
Gets or sets Y coordinate
|
double |
getZ()
Gets or sets Z coordinate
|
int |
hashCode()
Return hash code for object.
|
Point3D |
normalize()
Normalizes the specified origin.
|
static Point3D |
normalVector(Point3D point1,
Point3D point2,
Point3D point3)
Get normal vector of a plane.
|
static Point3D |
op_Addition(Point3D a,
Point3D b)
Implements the operator +.
|
static boolean |
op_Equality(Point3D a,
Point3D b)
Allows to compare 3D points.
|
static boolean |
op_Inequality(Point3D a,
Point3D b)
Allows to compare 3D points.
|
static Point3D |
op_Multiply(Point3D point,
double scale)
Implements the operator *.
|
static Point3D |
op_Subtraction(Point3D a,
Point3D b)
Implements the operator -.
|
void |
setW(double value)
Gets or sets W coordinate
|
void |
setX(double value)
Gets or sets X coordinate
|
void |
setY(double value)
Gets or sets Y coordinate
|
void |
setZ(double value)
Gets or sets Z coordinate
|
static Point3D |
spherical(double r,
double theta,
double phi)
Get point in spherical coordinates
|
void |
transform(TransformationMatrix matrix)
Applies transformation to a point
|
void |
transformNormalize(TransformationMatrix matrix)
Applies transformation with normalization.
|
public Point3D()
Initializes a new instance of the Point3D class
public Point3D(double x, double y, double z, double w)
Initializes a new instance of the Point3D class
x
- X valuey
- Y valuez
- Z valuew
- W valuepublic Point3D(double x, double y)
Initializes a new instance of the Point3D class
x
- X valuey
- Y valuepublic Point3D(double x, double y, double z)
Initializes a new instance of the Point3D class
x
- X valuey
- Y valuez
- Z valuepublic Point3D(com.aspose.foundation.rendering.ApsPoint apsPoint)
Initializes a new instance of the Point3D class.
apsPoint
- The cad2 d point.public double getX()
Gets or sets X coordinate
public void setX(double value)
Gets or sets X coordinate
public double getY()
Gets or sets Y coordinate
public void setY(double value)
Gets or sets Y coordinate
public double getZ()
Gets or sets Z coordinate
public void setZ(double value)
Gets or sets Z coordinate
public double getW()
Gets or sets W coordinate
public void setW(double value)
Gets or sets W coordinate
public static double distance(Point3D point1, Point3D point2)
Gets distance between points
point1
- First pointpoint2
- Second pointpublic static Point3D spherical(double r, double theta, double phi)
Get point in spherical coordinates
r
- R valuetheta
- Theta valuephi
- Phi valuepublic static Point3D crossProduct(Point3D point1, Point3D point2)
Gets cross-product of a points
point1
- First pointpoint2
- Second pointpublic static double dotProduct(Point3D point1, Point3D point2)
Gets dot product between two vectors.
point1
- First vector.point2
- Second vector.public static Point3D normalVector(Point3D point1, Point3D point2, Point3D point3)
Get normal vector of a plane.
point1
- First vector of a plane.point2
- Second vector of a plane.point3
- Third vector of a plane.public void transform(TransformationMatrix matrix)
Applies transformation to a point
matrix
- Transformation matrixpublic void transformNormalize(TransformationMatrix matrix)
Applies transformation with normalization.
matrix
- Matrix to perform transformation.public static boolean op_Equality(Point3D a, Point3D b)
Allows to compare 3D points.
a
- First point to compare.b
- Second point to compare.public static boolean op_Inequality(Point3D a, Point3D b)
Allows to compare 3D points.
a
- First point to compare.b
- Second point to compare.public static Point3D op_Subtraction(Point3D a, Point3D b)
Implements the operator -.
a
- a.b
- The b.public static Point3D op_Addition(Point3D a, Point3D b)
Implements the operator +.
a
- a.b
- The b.public static Point3D op_Multiply(Point3D point, double scale)
Implements the operator *.
point
- The point.scale
- The scale.public boolean equals(Object obj)
Allows to compare 3D points.
public final boolean equalsSoft(Object obj)
public final boolean equalsSoft(Object obj, double eps)
Allows to compare 3D points with specified threshold.
obj
- Point to compare current object with.eps
- Epsilon threshold.public int hashCode()
Return hash code for object.
public Point3D copy()
Creates copy of current point
public final Point3D normalize()
Normalizes the specified origin.