skspatial.objects.Triangle.area¶
- Triangle.area() float64 [source]¶
Return the area of the triangle.
The points are the vertices of the triangle. They must be 3D or less.
- Returns:
- np.float64
The area of the triangle.
References
http://mathworld.wolfram.com/TriangleArea.html
Examples
>>> from skspatial.objects import Triangle
>>> Triangle([0, 0], [0, 1], [1, 0]).area() np.float64(0.5)
>>> Triangle([0, 0], [0, 2], [1, 1]).area() np.float64(1.0)
>>> Triangle([3, -5, 1], [5, 2, 1], [9, 4, 2]).area().round(2) np.float64(12.54)