Calculate the Polygon area and length (perimeter).
pip3 install torchstuff
import torch
from torchstuff.polygon import Polygon
# Example vertices
vertices = torch.tensor([[0., 0.], [0., 1.], [1., 1.], [1., 0.], [0., 0.]])
# Create Polygon object
polygon = Polygon(vertices)
# Access properties
area = polygon.area
length = polygon.length
print(f"Area: {area}, Length: {length}")
Just me for now