Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "math/manhattan-distance"

Index

Functions

Functions

manhattanDistance

  • manhattanDistance(point1: Point, point2: Point): number
  • manhattanDistance(point1: [number, number], point2: [number, number]): number
  • manhattanDistance(x1: number, y1: number, x2: number, y2: number): number
  • Gets the Manhattan distance between two points (x1, y1) and (x2, y2); the distance between two points measured along axes at right angles.

    Parameters

    • point1: Point

      The { x, y } point 1.

    • point2: Point

      The { x, y } point 2.

    Returns number

    The manhattan distance between the two points.

  • Gets the Manhattan distance between two points (x1, y1) and (x2, y2); the distance between two points measured along axes at right angles.

    Parameters

    • point1: [number, number]

      The [ x, y ] point 1.

    • point2: [number, number]

      The [ x, y ] point 2.

    Returns number

    The manhattan distance between the two points.

  • Gets the Manhattan distance between two points (x1, y1) and (x2, y2); the distance between two points measured along axes at right angles.

    Parameters

    • x1: number

      Point 1's x.

    • y1: number

      Point 1's y.

    • x2: number

      Point 2's x.

    • y2: number

      Point 2's y.

    Returns number

    The manhattan distance between the two points.

Generated using TypeDoc