# Class: Point

A Point is really used as a 2-dimensional vector, equally useful for representing a point on a plane, or the height and width of a plane not requiring any other frame of reference.
Members Methods

## Constructor

#### new Point(xopt, yopt)

##### Parameters:
Name Type Attributes Description
`x` Number <optional>
The vector component 'x'. Defaults to the origin at 0.
`y` Number <optional>
The vector component 'y'. Defaults to the origin at 0.
Source:

### Members

#### x :Number

The vector component 'x'.
• Number
Source:

#### y :Number

The vector component 'y'.
• Number
Source:

### Methods

Apply a function to each coordinate of this point and return a new point.
##### Parameters:
Name Type Description
`func` function The function to apply to each coordinate.
Source:
##### Returns:
A new point with the coordinates computed by the specified function
Type

Source:
##### Returns:
a duplicate of this Point
Type

#### distanceTo(point) → {Number}

Compute the distance between this point and another point.
##### Parameters:
Name Type Description
`point` OpenSeadragon.Point The point to compute the distance with.
Source:
##### Returns:
The distance between the 2 points
Type
Number

Divide this point by a factor and return a new Point.
##### Parameters:
Name Type Description
`factor` Number The factor to divide vector components.
Source:
##### Returns:
A new point representing the division of the vector components by the factor
Type

#### equals(point) → {Boolean}

Check if this point is equal to another one.
##### Parameters:
Name Type Description
`point` OpenSeadragon.Point The point to compare this point with.
Source:
##### Returns:
true if they are equal, false otherwise.
Type
Boolean

Subtract another Point to this point and return a new Point.
##### Parameters:
Name Type Description
`point` OpenSeadragon.Point The point to subtract vector components.
Source:
##### Returns:
A new point representing the subtraction of the vector components
Type

Compute the opposite of this point and return a new Point.
Source:
##### Returns:
A new point representing the opposite of the vector components
Type

Add another Point to this point and return a new Point.
##### Parameters:
Name Type Description
`point` OpenSeadragon.Point The point to add vector components.
Source:
##### Returns:
A new point representing the sum of the vector components
Type

Rotates the point around the specified pivot From http://stackoverflow.com/questions/4465931/rotate-rectangle-around-a-point
##### Parameters:
Name Type Attributes Default Description
`degress` Number to rotate around the pivot.
`pivot` OpenSeadragon.Point <optional>
(0,0) Point around which to rotate. Defaults to the origin.
Source:
##### Returns:
. A new point representing the point rotated around the specified pivot
Type

#### squaredDistanceTo(point) → {Number}

Compute the squared distance between this point and another point. Useful for optimizing things like comparing distances.
##### Parameters:
Name Type Description
`point` OpenSeadragon.Point The point to compute the squared distance with.
Source:
##### Returns:
The squared distance between the 2 points
Type
Number

Multiply this point by a factor and return a new Point.
##### Parameters:
Name Type Description
`factor` Number The factor to multiply vector components.
Source:
##### Returns:
A new point representing the multiplication of the vector components by the factor
Type