Ad
  • Custom User Avatar

    Draw the line with 'x' which connects the given points.
    If the points are diagonal, a rectangle instead of diagonal line should be drawn

    Regarding the points being diagonal, how can we verify this for a rectangle?

    For a square, i.e. if the points are diagonal, we can verify with this formula:

    |𝑥1−𝑥2|=|𝑦1−𝑦2|

    this wouldn't apply for a rectangle

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution