Quarter verification function

For entry of coordinates (2.0) ; (2.2); (0.2); (0.0) square is not found. I understand the function doesn't take many cases into account, but why when I ask a square, the function doesn't give anything?
bool TryToFormSquare (const Point& p1, const Point& p2, const Point& p3, const Point& p4, Rect& rect) { if ( (sqrt((p2.xp1.x) * (p2.xp1.x) + (p2.yp1.y) * (p2.yp1.y))) == (sqrt((p3.xp2.x)*(p3.xp2.x)+(p3.yp2.y)*(p3.yp2.y)))==(sqrt((p4.xp3.x)*(p4.xp3.x)+(p4.yp3.y)*(p4.yp3.y)))==(sqrt((p1.xp4.x)*(p1.xp4.x)+(p1.yp4.y)*(p1.yp4.y)))) { return true; } else if ((sqrt((p1.xp3.x)*(p1.xp3.x)+(p1.yp3.y)*(p1.yp3.y)))==(sqrt((p3.xp2.x)*(p3.xp2.x)+(p3.yp2.y)*(p3.yp2.y)))==(sqrt((p4.xp2.x)*(p4.xp2.x)+(p4.yp2.y)*(p4.yp2.y)))==(sqrt((p1.xp4.x)*(p1.xp4.x)+(p1.yp4.y)*(p1.yp4.y)))) { return true; } else if ((sqrt((p1.xp2.x)*(p1.xp2.x)+(p1.yp2.y)*(p1.yp2.y)))==(sqrt((p4.xp2.x)*(p4.xp2.x)+(p4.yp2.y)*(p4.yp2.y)))==(sqrt((p3.xp4.x)*(p3.xp4.x)+(p3.yp4.y)*(p3.yp4.y)))==(sqrt((p1.xp3.x)*(p1.xp3.x)+(p1.yp3.y)*(p1.yp3.y)))) { return true; } else { return false; } }
Since I'm a newcomer, I can't answer my questions, so here's the code of the correct function:
bool TryToFormSquare(const Point& p1, const Point& p2, const Point& p3, const Point& p4, Rect& rect) { if (((sqrt((p2.xp1.x)*(p2.xp1.x)+(p2.yp1.y)*(p2.yp1.y)))==(sqrt((p3.xp2.x)*(p3.xp2.x)+(p3.yp2.y)*(p3.yp2.y))))&&((sqrt((p3.xp2.x)*(p3.xp2.x)+(p3.yp2.y)*(p3.yp2.y)))==(sqrt((p4.xp3.x)*(p4.xp3.x)+(p4.yp3.y)*(p4.yp3.y))))&&((sqrt((p4.xp3.x)*(p4.xp3.x)+(p4.yp3.y)*(p4.yp3.y)))==(sqrt((p1.xp4.x)*(p1.xp4.x)+(p1.yp4.y)*(p1.yp4.y))))&&((sqrt((p1.xp3.x)*(p1.xp3.x)+(p1.yp3.y)*(p1.yp3.y)))==(sqrt((p4.xp2.x)*(p4.xp2.x)+(p4.yp2.y)*(p4.yp2.y))))) {return true;} else if (((sqrt((p1.xp3.x)*(p1.xp3.x)+(p1.yp3.y)*(p1.yp3.y)))==(sqrt((p3.xp2.x)*(p3.xp2.x)+(p3.yp2.y)*(p3.yp2.y))))&&((sqrt((p3.xp2.x)*(p3.xp2.x)+(p3.yp2.y)*(p3.yp2.y)))==(sqrt((p4.xp2.x)*(p4.xp2.x)+(p4.yp2.y)*(p4.yp2.y))))&&((sqrt((p4.xp2.x)*(p4.xp2.x)+(p4.yp2.y)*(p4.yp2.y)))==(sqrt((p1.xp4.x)*(p1.xp4.x)+(p1.yp4.y)*(p1.yp4.y))))&&((sqrt((p2.xp1.x)*(p2.xp1.x)+(p2.yp1.y)*(p2.yp1.y)))==(sqrt((p4.xp3.x)*(p4.xp3.x)+(p4.yp3.y)*(p4.yp3.y))))) {return true;} else if (((sqrt((p1.xp2.x)*(p1.xp2.x)+(p1.yp2.y)*(p1.yp2.y)))==(sqrt((p4.xp2.x)*(p4.xp2.x)+(p4.yp2.y)*(p4.yp2.y))))&&((sqrt((p4.xp2.x)*(p4.xp2.x)+(p4.yp2.y)*(p4.yp2.y)))==(sqrt((p3.xp4.x)*(p3.xp4.x)+(p3.yp4.y)*(p3.yp4.y))))&&((sqrt((p3.xp4.x)*(p3.xp4.x)+(p3.yp4.y)*(p3.yp4.y)))==(sqrt((p1.xp3.x)*(p1.xp3.x)+(p1.yp3.y)*(p1.yp3.y))))&&((sqrt((p1.xp4.x)*(p1.xp4.x)+(p1.yp4.y)*(p1.yp4.y)))==(sqrt((p3.xp2.x)*(p3.xp2.x)+(p3.yp2.y)*(p3.yp2.y))))) {return true;} else {return false;} }

 Read the code  remove it.
 sqrt() is not necessary  the equality of the numbers and the equality of the squares of the chiel is equivalent and the calculations vary.
 Bloki ifelse doesn't really need it. Once the condition worked, we went out.
 XZ, how does design aa=bb==cc==dd, provided. I would write aa==dd " tie aa===bb " .
 It may be necessary to separate the wording of the distance (or square) between two points.