Function normaliseByRect

Normalises a point so it is on a 0..1 scale

Point, or x

y coord or width

height or width

height

Point

  • Normalises a point by a given width and height

    Parameters

    • point: Point

      Point

    • width: number

      Width

    • height: number

      Height

    Returns Point

  • Normalises a point by a given rect's width and height

    Parameters

    Returns Point

  • Normalises x,y by width and height so it is on a 0..1 scale

    Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns Point