Reference Source
public class | source

Point

Extends:

leaflet~L.Point → Point

Point class

Example:

var point = new KQ.Struct.Point(200, 300);

Constructor Summary

Public Constructor
public

constructor(x: Number, y: Number, isRound: Boolean)

Constructor

Method Summary

Public Methods
public

add(point: Point): Point

Returns the result of addition of the current and the given points

public

ceil(): Point

Returns a copy of the current point with ceiled coordinates (rounded up)

public

Returns the cartesian distance between the current and the given points

public

Returns the result of division of the current point by the given number

public

equals(point: Point): Boolean

Returns true if the given point has the same coordinates

public

Returns a copy of the current point with floored coordinates (rounded down)

public

Returns the result of multiplication of the current point by the given number

public

Returns a copy of the current point with rounded coordinates

public

subtract(point: Point): Point

Returns the result of subtraction of the given point from the current

public

Returns a string representation of the point for debugging purposes

Public Constructors

public constructor(x: Number, y: Number, isRound: Boolean) source

Constructor

Params:

NameTypeAttributeDescription
x Number

x position

y Number

y position

isRound Boolean
  • optional
  • default: false

If optional isRound is set to true, rounds the x and y values

Public Methods

public add(point: Point): Point source

Returns the result of addition of the current and the given points

Params:

NameTypeAttributeDescription
point Point

point object

Return:

Point

public ceil(): Point source

Returns a copy of the current point with ceiled coordinates (rounded up)

Return:

Point

public distanceTo(point: Point): Number source

Returns the cartesian distance between the current and the given points

Params:

NameTypeAttributeDescription
point Point

another point

Return:

Number

public divideBy(num: Number): Point source

Returns the result of division of the current point by the given number

Params:

NameTypeAttributeDescription
num Number

divisor

Return:

Point

public equals(point: Point): Boolean source

Returns true if the given point has the same coordinates

Params:

NameTypeAttributeDescription
point Point

another point

Return:

Boolean

public floor(): Point source

Returns a copy of the current point with floored coordinates (rounded down)

Return:

Point

public multiplyBy(num: Number): Point source

Returns the result of multiplication of the current point by the given number

Params:

NameTypeAttributeDescription
num Number

multiplier

Return:

Point

public round(): Point source

Returns a copy of the current point with rounded coordinates

Return:

Point

public subtract(point: Point): Point source

Returns the result of subtraction of the given point from the current

Params:

NameTypeAttributeDescription
point Point

point object

Return:

Point

public toString(): String source

Returns a string representation of the point for debugging purposes

Return:

String