Optionalx: numberThe x coordinate of this Point. Default 0.
Optionaly: numberThe y coordinate of this Point. Default x.
ReadonlytypeThe geometry constant type of this object: GEOM_CONST.POINT.
Used for fast type comparisons.
The x coordinate of this Point.
The y coordinate of this Point.
Set the x and y coordinates of the point to the given values.
Optionalx: numberThe x coordinate of this Point. Default 0.
Optionaly: numberThe y coordinate of this Point. Default x.
StaticCeilStaticCloneStaticCopyStaticEqualsStaticFloorStaticGetGet the centroid or geometric center of a plane figure (the arithmetic mean position of all the points in the figure). Informally, it is the point at which a cutout of the shape could be perfectly balanced on the tip of a pin.
An array of Vector2Like objects to get the geometric center of.
Optionalout: OA Point object to store the output coordinates in. If not given, a new Point instance is created.
StaticGetCalculate the magnitude of the point, which equivalent to the length of the line from the origin to this point.
The point to calculate the magnitude for
StaticGetCalculates the square of magnitude of given point.(Can be used for fast magnitude calculation of point)
Returns square of the magnitude/length of given point.
StaticGetCalculates the Axis Aligned Bounding Box (or aabb) from an array of points.
An array of Vector2Like objects to get the AABB from.
Optionalout: OA Rectangle object to store the results in. If not given, a new Rectangle instance is created.
StaticInterpolateReturns the linear interpolation point between the two given points, based on t.
The starting Point for the interpolation.
The target Point for the interpolation.
Optionalt: numberThe amount to interpolate between the two points. Generally, a value between 0 (returns the starting Point) and 1 (returns the target Point). If omitted, 0 is used. Default 0.
Optionalout: OAn optional Point object whose x and y values will be set to the result of the interpolation (can also be any object with x and y properties). If omitted, a new Point created and returned.
StaticInvertStaticNegativeStaticProjectStaticProjectStaticSet
Defines a Point in 2D space, with an x and y component.