Point3D
Represents class to work with 3D point and special operations for it.
Constructors
| Constructor | Description |
|---|---|
| Point3D() | 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 |
| 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(com.aspose.foundation.rendering.ApsPoint apsPoint) | Initializes a new instance of the Point3D class. |
Methods
| Method | Description |
|---|---|
| getX() | Gets or sets X coordinate |
| setX(double value) | Gets or sets X coordinate |
| getY() | Gets or sets Y coordinate |
| setY(double value) | Gets or sets Y coordinate |
| getZ() | Gets or sets Z coordinate |
| setZ(double value) | Gets or sets Z coordinate |
| getW() | Gets or sets W coordinate |
| setW(double value) | Gets or sets W coordinate |
| distance(Point3D point1, Point3D point2) | Gets distance between points |
| spherical(double r, double theta, double phi) | Get point in spherical coordinates |
| crossProduct(Point3D point1, Point3D point2) | Gets cross-product of a points |
| dotProduct(Point3D point1, Point3D point2) | Gets dot product between two vectors. |
| normalVector(Point3D point1, Point3D point2, Point3D point3) | Get normal vector of a plane. |
| transform(TransformationMatrix matrix) | Applies transformation to a point |
| transformNormalize(TransformationMatrix matrix) | Applies transformation with normalization. |
| op_Equality(Point3D a, Point3D b) | Allows to compare 3D points. |
| op_Inequality(Point3D a, Point3D b) | Allows to compare 3D points. |
| op_Subtraction(Point3D a, Point3D b) | Implements the operator -. |
| op_Addition(Point3D a, Point3D b) | Implements the operator +. |
| op_Multiply(Point3D point, double scale) | Implements the operator *. |
| equals(Object obj) | Allows to compare 3D points. |
| equalsSoft(Object obj) | |
| equalsSoft(Object obj, double eps) | Allows to compare 3D points with specified threshold. |
| hashCode() | Return hash code for object. |
| copy() | Creates copy of current point |
| normalize() | Normalizes the specified origin. |
Point3D()
public Point3D()
Initializes a new instance of the Point3D class
Point3D(double x, double y, double z, double w)
public Point3D(double x, double y, double z, double w)
Initializes a new instance of the Point3D class
Parameters:
| Parameter | Type | Description |
|---|---|---|
| x | double | X value |
| y | double | Y value |
| z | double | Z value |
| w | double | W value |
Point3D(double x, double y)
public Point3D(double x, double y)
Initializes a new instance of the Point3D class
Parameters:
| Parameter | Type | Description |
|---|---|---|
| x | double | X value |
| y | double | Y value |
Point3D(double x, double y, double z)
public Point3D(double x, double y, double z)
Initializes a new instance of the Point3D class
Parameters:
| Parameter | Type | Description |
|---|---|---|
| x | double | X value |
| y | double | Y value |
| z | double | Z value |
Point3D(com.aspose.foundation.rendering.ApsPoint apsPoint)
public Point3D(com.aspose.foundation.rendering.ApsPoint apsPoint)
Initializes a new instance of the Point3D class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| apsPoint | com.aspose.foundation.rendering.ApsPoint | The cad2 d point. |
getX()
public double getX()
Gets or sets X coordinate
Returns: double
setX(double value)
public void setX(double value)
Gets or sets X coordinate
getY()
public double getY()
Gets or sets Y coordinate
Returns: double
setY(double value)
public void setY(double value)
Gets or sets Y coordinate
getZ()
public double getZ()
Gets or sets Z coordinate
Returns: double
setZ(double value)
public void setZ(double value)
Gets or sets Z coordinate
getW()
public double getW()
Gets or sets W coordinate
Returns: double
setW(double value)
public void setW(double value)
Gets or sets W coordinate
distance(Point3D point1, Point3D point2)
public static double distance(Point3D point1, Point3D point2)
Gets distance between points
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point1 | Point3D | First point |
| point2 | Point3D | Second point |
Returns: double - Euclidean distance
spherical(double r, double theta, double phi)
public static Point3D spherical(double r, double theta, double phi)
Get point in spherical coordinates
Parameters:
| Parameter | Type | Description |
|---|---|---|
| r | double | R value |
| theta | double | Theta value |
| phi | double | Phi value |
Returns: Point3D - Spherical coordinates point
crossProduct(Point3D point1, Point3D point2)
public static Point3D crossProduct(Point3D point1, Point3D point2)
Gets cross-product of a points
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point1 | Point3D | First point |
| point2 | Point3D | Second point |
Returns: Point3D - Cross product point
dotProduct(Point3D point1, Point3D point2)
public static double dotProduct(Point3D point1, Point3D point2)
Gets dot product between two vectors.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point1 | Point3D | First vector. |
| point2 | Point3D | Second vector. |
Returns: double - Dor product
normalVector(Point3D point1, Point3D point2, Point3D point3)
public static Point3D normalVector(Point3D point1, Point3D point2, Point3D point3)
Get normal vector of a plane.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point1 | Point3D | First vector of a plane. |
| point2 | Point3D | Second vector of a plane. |
| point3 | Point3D | Third vector of a plane. |
Returns: Point3D - Normal vector of a plane
transform(TransformationMatrix matrix)
public void transform(TransformationMatrix matrix)
Applies transformation to a point
Parameters:
| Parameter | Type | Description |
|---|---|---|
| matrix | TransformationMatrix | Transformation matrix |
transformNormalize(TransformationMatrix matrix)
public void transformNormalize(TransformationMatrix matrix)
Applies transformation with normalization.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| matrix | TransformationMatrix | Matrix to perform transformation. |
op_Equality(Point3D a, Point3D b)
public static boolean op_Equality(Point3D a, Point3D b)
Allows to compare 3D points.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| a | Point3D | First point to compare. |
| b | Point3D | Second point to compare. |
Returns: boolean - True if points are equal.
op_Inequality(Point3D a, Point3D b)
public static boolean op_Inequality(Point3D a, Point3D b)
Allows to compare 3D points.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| a | Point3D | First point to compare. |
| b | Point3D | Second point to compare. |
Returns: boolean - True if points are different.
op_Subtraction(Point3D a, Point3D b)
public static Point3D op_Subtraction(Point3D a, Point3D b)
Implements the operator -.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| a | Point3D | a. |
| b | Point3D | The b. |
Returns: Point3D - The result of the operator.
op_Addition(Point3D a, Point3D b)
public static Point3D op_Addition(Point3D a, Point3D b)
Implements the operator +.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| a | Point3D | a. |
| b | Point3D | The b. |
Returns: Point3D - The result of the operator.
op_Multiply(Point3D point, double scale)
public static Point3D op_Multiply(Point3D point, double scale)
Implements the operator *.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| point | Point3D | The point. |
| scale | double | The scale. |
Returns: Point3D - The result of the operator.
equals(Object obj)
public boolean equals(Object obj)
Allows to compare 3D points.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| obj | Object | Point to compare current object with. |
Returns: boolean - True if points are equal.
equalsSoft(Object obj)
public final boolean equalsSoft(Object obj)
Returns: boolean
equalsSoft(Object obj, double eps)
public final boolean equalsSoft(Object obj, double eps)
Allows to compare 3D points with specified threshold.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| obj | Object | Point to compare current object with. |
| eps | double | Epsilon threshold. |
Returns: boolean - True if points are equal.
hashCode()
public int hashCode()
Return hash code for object.
Returns: int - Hash value.
copy()
public Point3D copy()
Creates copy of current point
Returns: Point3D - Copy of a point
normalize()
public final Point3D normalize()
Normalizes the specified origin.
Returns: Point3D