Options
All
  • Public
  • Public/Protected
  • All
Menu

Class for expressing a Cartesian point (pair of coordinates).

Hierarchy

  • Point

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Point(x: number, y: number): Point
  • Parameters

    • x: number

      Coordinate for X axis.

    • y: number

      Coordinate for Y axis.

    Returns Point

Properties

x

x: number

Coordinate for X axis.

y

y: number

Coordinate for Y axis.

Methods

Static add

  • Adds two points. Each coordinate gets added with corresponding coordinate of other point (x gets added with x, y with y).

    Parameters

    • first: Point

      One of the points to add.

    • second: Point

      Other point to add.

    Returns Point

    Sum of coordinates.

Static delta

  • Calculates a delta (difference) between two points.

    Parameters

    • start: Point

      Beggining point (one that will be subtracted).

    • end: Point

      End point (one from which start will be substracted).

    Returns Point

    Delta (difference) between two points.

Static distance

  • Calculates the Euclidean distance between two points.

    Parameters

    • first: Point

      One of the points.

    • second: Point

      Other point.

    Returns number

    Euclidean distance between the points.

Static multiply

  • Multiplies each of the coordinates of the point by factor. Result is new point where x * factor, y * factor.

    Parameters

    • point: Point

      Point to be multiplied.

    • factor: number

      Factor to multiply by.

    Returns Point

    Multiplication result.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc