Point2D

external class Point2D : JsAny

The Point2D class defines a point representing a location in

This class is only the abstract superclass for all objects that store a 2D coordinate. The actual storage representation of the coordinates is left to the subclass.

Author

Jim Graham

Since

1.2

Constructors

Link copied to clipboard
constructor()

Constructs and initializes a Point2D with coordinates (0, 0).

constructor(pt: POINT2)

add the constructor

constructor(x: double, y: double)

Constructs and initializes a Point2D with the specified coordinates.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var x: double

The X coordinate of this Point2D.

Link copied to clipboard
var y: double

The Y coordinate of this Point2D.

Functions

Link copied to clipboard
fun clone(): Point2D
Link copied to clipboard
fun distance(px: double, py: double): Double

Returns the distance from this Point2D to a specified point.

Link copied to clipboard

Determines whether or not two points are equal. Two instances of Point2D are equal if the values of their x and y member fields, representing their position in the coordinate space, are the same.

Link copied to clipboard
fun getX(): double

{@inheritDoc}

Link copied to clipboard
fun getY(): double

{@inheritDoc}

Link copied to clipboard

Sets the location of this Point2D to the same coordinates as the specified Point2D object.

Sets the location of this Point2D to the specified double coordinates.