An integer-based point.

See also:

Constructor

@:value({ y : 0, x : 0 })inlinenew(x:Int = 0, y:Int = 0)

Create a new integer Point instance.

Parameters:

x

Horizontal position of the point.

y

Vertical position of the point.

Variables

x:Int

Horizontal position of the point.

y:Int

Vertical position of the point.

Methods

inlineadd(p:IPoint):IPoint

Adds IPoint p to this IPoint and returns new Point with the result.

inlineclone():IPoint

Returns a copy of this IPoint.

inlinecross(p:IPoint):Int

Returns a cross product between this IPoint and a given IPoint p.

inlinedistance(p:IPoint):Float

Returns a distance between this IPoint and given IPoint p.

inlinedistanceSq(p:IPoint):Int

Returns squared distance between this IPoint and given IPoint p.

inlinedot(p:IPoint):Int

Returns a dot product between this IPoint and given IPoint p.

inlineequals(other:IPoint):Bool

Tests if this IPoint position equals to other IPoint position.

inlinelength():Float

Returns length (distance to 0,0) of this IPoint.

inlinelengthSq():Int

Returns squared length of this IPoint.

inlineload(p:IPoint):Void

Copy the position from the give point p into this IPoint.

inlinemultiply(v:Int):IPoint

Returns a new IPoint with the position of this IPoint multiplied by a given scalar v.

inlinescale(v:Int):Void

Multiplies the position of this IPoint by a given scalar v. Modifies this instance.

@:value({ y : 0, x : 0 })inlineset(x:Int = 0, y:Int = 0):Void

Sets the IPoint x, y with given values.

inlinesub(p:IPoint):IPoint

Subtracts IPoint p from this IPoint and returns new Point with the result.

@:value({ scale : 1. })inlinetoPoint(scale:Float = 1.):Point

Converts this IPoint to floating point-based Point scaled by provided scalar scale.