Given two points A(x1, y1) and B(x2, y2), find the distance between them. Formula To Calculate Distance Between Two Points…