magnet.cell.Triangle#
- class magnet.cell.Triangle(nodes=None, mesh_vertices=None, faces=None)#
Bases:
Polygon
Triangular cell.
Constructor
- __init__(nodes=None, mesh_vertices=None, faces=None) None #
Methods
- area()#
Compute the area of the triangle.
- Parameters:
None
- Returns:
Area value.
- Return type:
float
- centroid()#
Compute centroid coordinates of the triangle.
- Parameters:
None
- Returns:
Array of shape (2,) corresponding to the centroid coordiantes.
- Return type:
np.ndarray of float
Inherited Methods
__init__
([nodes, mesh_vertices, faces])inscribed_diameter
([center])Compute the diameter of the inscribed circle of the cell.
is_counterclockwise
()Check if polygon vertices are ordered counterclockwise.
is_inside
(p)Check if a point is inside the polygon.
perimeter
()Compute the perimeter of the polygon.
sort_nodes
()Sort nodes of a polygon on the perimeter.
volume_center
()Compute the area and centroid of the polygon.