# Class: Point

## Point

A point, represented by its cartesian coordinates.

## Constructor

#### new Point(a, b)

Constructs a point of cartesian coordinates (x=a, y=b).
##### Parameters:
Name Type Description
`a` number
`b` number
Source:

### Members

#### x

Returns the horizontal coordinate of the cartesian coordinates.
Source:

#### y

Returns the vertical coordinate of the cartesian coordinates.
Source:

### Methods

Returns a new point that is the sum.
##### Parameters:
Name Type Description
`other` Point
Source:
Type
Point

#### compare(other) → {number}

Compare two points before with x coordinate and maybe after with y coordinate.
##### Parameters:
Name Type Description
`other` Point
Source:
-1, 0 or 1
Type
number

#### distance(other) → {number}

Returns the distance between the two points.
##### Parameters:
Name Type Description
`other` Point
Source:
>= 0
Type
number

#### distanceSqr(other) → {number}

Returns the square of the distance between the two points.
##### Parameters:
Name Type Description
`other` Point
Source:
>= 0
Type
number

#### distanceTo0() → {number}

Returns the distance to (0, 0).
Source:
>= 0
Type
number

#### distanceTo0Sqr() → {number}

Returns the square of the distance to (0, 0).
Source:
>= 0
Type
number

#### isEquals(other) → {boolean}

Returns true iff the point is equals to the point other, namely iff they are same cartesian coordinates.
##### Parameters:
Name Type Description
`other` Point
Source:
Type
boolean

#### mulScalar() → {Point}

Returns a new point multiply by the scalar n.
Source:
Type
Point

#### sub(other) → {Point}

Returns a new point that is the difference.
##### Parameters:
Name Type Description
`other` Point
Source:
Type
Point

#### toString() → {String}

Returns a string cartesian representation of the point. Each number is represented with at most precision figures after the decimal point.
Source:
Type
String