From 5c733c2b32a3a716e968aa4a8499898941b3ae5d Mon Sep 17 00:00:00 2001 From: Daniel <59575049+lemoentjiez@users.noreply.github.com> Date: Mon, 5 Dec 2022 14:09:21 +0200 Subject: [PATCH] Update fourth.py --- LabPSA_2/fourth.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/LabPSA_2/fourth.py b/LabPSA_2/fourth.py index 435b78b..33923bf 100644 --- a/LabPSA_2/fourth.py +++ b/LabPSA_2/fourth.py @@ -9,9 +9,7 @@ for _ in range(100000): len1 = sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) len2 = sqrt((x3 - x1) ** 2 + (y3 - y1) ** 2) len3 = sqrt((x3 - x2) ** 2 + (y3 - y2) ** 2) - list1 = [len1, len2, len3] - list1.sort() - if list1[0] ** 2 + list1[1] ** 2 > list1[2] ** 2: + if len1 ** 2 + len2 ** 2 > len3 ** 2 and len2 ** 2 + len3 ** 2 > len1 ** 2 and len1 ** 2 + len3 ** 2 > len2 ** 2: counter+=1 print(counter/100000)