Point
A point representing a location (x, y) in two-dimensional coordinate space.
Definition
Package:@progress/kendo-drawing
Methods
Adds an observer to be notified for changes.
Creates a new instance with the same coordinates.
- A new Point instance with the same coordinates.
Creates a Point instance with the specified coordinates.
The X coordinate of the point
ynumberThe Y coordinate of the point.
Returns:- The new Point instance.
Creates a Point instance with the specified coordinates.
Calculates the distance to another point.
The point to calculate the distance to.
Returns:number
- The straight-line distance to the given point.
Compares this point with another instance.
The point to compare with.
Returns:boolean
true if the point coordinates match. Otherwise, returns false.
Gets the x coordinate value.
number
- The current X-coordinate value.
Gets the Y-coordinate value.
number
- The current Y-coordinate value.
Returns a Point with the largest representable coordinates.
- A new Point instance with maximum coordinates.
Returns a Point with the smallest representable coordinates.
- A new Point instance with minimum coordinates.
Moves the point to the specified X and Y coordinates.
The new X coordinate.
ynumberThe new Y coordinate.
Returns:- The current point instance.
Returns the list of observers.
- The current observers.
Stops notifying the specified observer for changes.
Resumes the notification to all observers for changes.
- The current Arc instance.
Rotates the point around the given center.
The angle in decimal degrees. Measured in a clockwise direction with 0 (zero) pointing "right". Negative values or values greater than 360 are normalized.
centerPoint | number[]The rotation center. Can be a Point instance or an [x, y] array.
- The current Point instance.
Rounds the point coordinates to the specified number of fractional digits.
Scales the point coordinates along the X and Y axis.
The X scale multiplier.
scaleYnumberThe Y scale multiplier.
Returns:- The current Point instance.
Scales the point coordinates on a copy of the current point. The callee coordinates will remain unchanged.
The X scale multiplier.
scaleYnumberThe Y scale multiplier.
Returns:- The current Point instance.
Sets the X coordinate to a new value.
Sets the Y coordinate to a new value.
Returns the point coordinates as an [X, Y] array.
The number of fractional digits.
Returns:number[]
- An array representation of the point. For example,
[10, 20].
Formats the point value to a string.
The number of fractional digits.
separator?stringThe separator to place between coordinates.
Returns:string
- A string representation of the point. For example,
"10, 20".
Applies a transformation to the point coordinates. The current coordinates will be overridden.
The transformation to apply.
Returns:- The current Point instance.
Applies a transformation on a copy of the current point. The callee coordinates will remain unchanged.
Translates the point along the X and Y axis.
The distance to move along the X axis.
dynumberThe distance to move along the Y axis.
Returns:- The current Point instance.