Seadragon.Point Class

Version - Back to Seadragon Ajax Library

Overview

A class that represents a 2-dimensional point.

Constructors

Signature Description
Seadragon.Point() Creates a point at (0, 0).
Seadragon.Point(x, y) Creates a point at (x, y).

Properties

Name Type Description
x Number The x value.
y Number The y value.

Methods

Name and Signature Return Type Description
plus(point) Seadragon.Point These operations return a new Seadragon.Point, without modifying the current Seadragon.Point. Note that plus() and minus() take Seadragon.Points while times() and divide() take numbers.
minus(point) Seadragon.Point
times(factor) Seadragon.Point
divide(factor) Seadragon.Point
apply(func) Seadragon.Point Applies the given function to both x and y, and returns a new Seadragon.Point. An example function is Math.round.
distanceTo(point) Number Returns the distance from this point to the given point.
equals(point) Boolean Returns true if this point has the same x and y as the given point.