Point
The Point
class represents a point in 2D space. It contains an array of two integers, which represent the coordinates of the point.
Definition
Namespace: Dynamsoft.Core
Assembly: Dynamsoft.Core.dll
public class Point
Methods
Method | Description |
---|---|
Point |
Constructor of a Point object. |
This |
Gets or sets the coordinate value at the specified index. |
Set |
Sets the coordinates of a point. |
DistanceTo |
Calculates the distance between the current point and the specified target point. |
TransformCoordinates |
Transforms the coordinates of a point using a given transformation matrix. |
Point
Initializes a new instance of the Point
class with default coordinates (0, 0).
Point()
Initializes a new instance of the Point
class by copying coordinates from another point.
Point(Point other)
Initializes a new instance of the Point
class with the specified coordinates.
Point(int x, int y)
Parameters
[in] other
The point from which to copy coordinates.
[in] x
The x-coordinate of the point.
[in] y
The y-coordinate of the point.
This
Gets or sets the coordinate value at the specified index.
int this[int index]
Parameters
[in] index
The index of the coordinate value to get or set. Index 0 corresponds to the x-coordinate, and index 1 corresponds to the y-coordinate.
Return Value
Returns the value of the coordinate at the specified index.
Set
Sets the coordinates of a point.
void Set(int x, int y)
Parameters
[in] x
The new x-coordinate of a point.
[in] y
The new y-coordinate of a point.
DistanceTo
Calculates the distance between the current point and the specified target point.
double DistanceTo(Point pt)
Parameters
[in] pt
The target point to which the distance is calculated.
Return Value
A value representing the distance between the current point and the specified target point.
TransformCoordinates
Transforms the coordinates of a point using a given transformation matrix.
static Point TransformCoordinates(Point originalPoint, double transformationMatrix[9])
Parameters
[in] originalPoint
The original point to transform.
[in] transformationMatrix
The transformation matrix to apply to the coordinates.
Return Value
Returns a new Point
object with the transformed coordinates.