from math import sqrt point1 = {"x":3, "y":3} point2 = {"x":1, "y":1} point3 = {"x":6, "y":1} a = sqrt( (point2["x"] - point1["x"])**2 + (point2["y"] - point1["y"])**2 ) b = sqrt( (point2["x"] - point3["x"])**2 + (point2["y"] - point3["y"])**2 ) c = sqrt( (point3["x"] - point1["x"])**2 + (point3["y"] - point1["y"])**2 ) P = a + b + c p = P/2 S = sqrt( p*(p-a)*(p-b)*(p-c) ) print(P, S)