Point
Constructors
Point
(x: number, y: number)
(point: TPoint)
Creates a new instance of the point with certain parameters
Point
.zero
()
Creates a new instance of the point with coordinates (0,0)
Point
.one
()
Creates a new instance of the point with coordinates (1,1)
Point
.from
(point: TPoint)
Creates a new instance of the point from a point like object
Point
.middle
(p0: TPoint, p1: TPoint)
Creates a new instance of the point in the between of two p0 and p1 points
Properties
x
:number
get set
Gets or sets x position of the point
y
:number
get set
Gets or sets y position of the point
length
:number
get
Gets a length
magnitude
:number
get
Gets a magnitude
magnitudeSq
:number
get
Gets a magnitudeSq
Methods
moveX Self
(x: number) ⇨ Point
Sets the point specified x coordinate
moveY Self
(y: number) ⇨ Point
Sets the point specified y coordinate
move Self
(x: number, y: number) ⇨ Point
(xy: number) ⇨ Point
(point: TPoint) ⇨ Point
Sets the point specified x and y coordinates
shiftX Self
(dx: number) ⇨ Point
Shifts the point specified x coordinate
shiftY Self
(dy: number) ⇨ Point
Shifts the point specified y coordinate
shift Self
(dx: number, dy: number) ⇨ Point
(dxy: number) ⇨ Point
(d: TPoint) ⇨ Point
Shifts the point on a new position
scaleX Self
(dx: number) ⇨ Point
Scales the point by x axis
scaleY Self
(dy: number) ⇨ Point
Scales the point by y axis
scale Self
(dx: number, dy: number) ⇨ Point
(dxy: number) ⇨ Point
(d: TPoint) ⇨ Point
Scales the point by specified axises
negX Self
() ⇨ Point
Does negative x coordinate (x * -1)
negY Self
() ⇨ Point
Does negative y coordinate (y * -1)
neg Self
() ⇨ Point
Does negative x and y coordinates (x * -1, y * -1)
abs Self
() ⇨ Point
Converts axises to absolute
equals
(point: TPoint) ⇨ boolean
Equals points
swapAxis Self
() ⇨ Point
Swaps axises
clone
() ⇨ Point
Creates copy of the point
rotate Self
(deg: number) ⇨ Point
Rotates the point around (0,0) point
dot
(point: TPoint) ⇨ number
Does dot
cross
(point: TPoint) ⇨ number
Does cross