add purge

This commit is contained in:
Theophile Terraz committed 2024-05-07 14:41:09 +02:00
1 parent cc3649fcb8
commit 5164891928
2 files changed
+41

No files matched your search

+8
View File
@@ -204,3 +204,11 @@ class PointXYZ(Point, SQLSubModel):
Euclidean distance between the two points
"""
return dist((p1.x, p1.y, p1.z), (p2.x, p2.y, p2.z))
@staticmethod
def areatriangle3d(p1, p2, p3):
a = PointXYZ.distance(p1, p2)
b = PointXYZ.distance(p2, p3)
c = PointXYZ.distance(p3, p1)
s = (a + b + c) / 2
return (s*(s-a) * (s-b)*(s-c)) ** 0.5