{"id":23811,"date":"2021-10-03T20:31:32","date_gmt":"2021-10-03T15:01:32","guid":{"rendered":"https:\/\/python-programs.com\/?p=23811"},"modified":"2021-11-22T18:33:25","modified_gmt":"2021-11-22T13:03:25","slug":"python-program-for-pythagorean-quadruple","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-pythagorean-quadruple\/","title":{"rendered":"Python Program for Pythagorean Quadruple"},"content":{"rendered":"

Given four points, the task is to check if the given four points form quadruple in python.<\/p>\n

Quadruple:<\/strong><\/p>\n

It is defined as a tuple of integers a, b, c, and d such that a2<\/sup> + b2<\/sup>\u00a0 + c2<\/sup>\u00a0= d2<\/sup>. They are, in fact, Diophantine Equations solutions. It represents a cuboid with integer side lengths |a|, |b|, and |c| and a space diagonal of |d| in the geometric interpretation.<\/p>\n

Condition to check Quadruple = a2<\/sup> + b2<\/sup>\u00a0 + c2<\/sup>\u00a0= d2<\/sup><\/strong><\/p>\n

where a, b, c, d are the given four points.<\/p><\/blockquote>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first point = 6\r\nGiven second point = 2\r\nGiven third point = 3\r\nGiven fourth point = 7<\/pre>\n

Output:<\/strong><\/p>\n

The given four points { 6 , 2 , 3 , 7 } forms a quadruple<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first point = 9\r\nGiven second point = 2\r\nGiven third point = 6 \r\nGiven fourth point = 11<\/pre>\n

Output:<\/strong><\/p>\n

The given four points { 9 , 2 , 6 , 11 } forms a quadruple<\/pre>\n

Program for Pythagorean Quadruple in Python<\/h2>\n

Below are the ways to check if the given four points form quadruple in python:<\/p>\n