Repository: roboflow/supervision
File: supervision/geometry/core.py (Python)

Code before:
    def as_xy_int_tuple(self) -> Tuple[int, int]:
        return int(self.x), int(self.y)

    def as_xy_float_tuple(self) -> Tuple[float, float]:
        return self.x, self.y


@dataclass
class Vector:
    start: Point
    end: Point

    def is_in(self, point: Point) -> bool:
        v1 = Vector(self.start, self.end)
        v2 = Vector(self.start, point)
        cross_product = (v1.end.x - v1.start.x) * (v2.end.y - v2.start.y) - (
            v1.end.y - v1.start.y
        ) * (v2.end.x - v2.start.x)
        return cross_product < 0

    def cross_product(self, point: Point) -> float:
        """
        Determine on which side of the vector a point lies.
        Returns a positive number if on one side, negative if on the other, and 0 if on the line.
        """
        cross_product = (self.end.x - self.start.x) * (point.y - self.start.y) - (
            self.end.y - self.start.y
        ) * (point.x - self.start.x)
        return cross_product


@dataclass
class Rect:
    x: float
    y: float
    width: float
    height: float

    @property
    def top_left(self) -> Point:
        return Point(x=self.x, y=self.y)

    @property
    def bottom_right(self) -> Point:
        return Point(x=self.x + self.width, y=self.y + self.height)

    def pad(self, padding) -> Rect:
        return Rect(
            x=self.x - padding,
            y=self.y - padding,
            width=self.width + 2 * padding,

Review comment (suggestion):
There are a few things I would like to address.

1. We generally require function/methods arguments and results to be documented in docstring. This docstring is later used to generate our documentation website automatically. 
2. Secondly, we already have [`is_in`](https://github.com/roboflow/supervision/blob/64661a3e4aae2830a37cc277ec2d73c9dee0ee1c/supervision/geometry/core.py#L46) method, responsible for very similar calculations. I don't like the `is_in` name. `cross_product` is a lot better. I'm happy that you made this change:

```python
# old
triggers = [self.vector.is_in(point=anchor) for anchor in anchors]

# new
triggers = [
    self.vector.cross_product(point=anchor) < 0 
    for anchor 
    in anchors
]
```

Please remove the old `is_in` method, and adjust [`test_vector_is_in`](https://github.com/roboflow/supervision/blob/64661a3e4aae2830a37cc277ec2d73c9dee0ee1c/test/geometry/test_dataclasses.py#L29) to test your new method.

Code after:

    def as_xy_int_tuple(self) -> Tuple[int, int]:
        return int(self.x), int(self.y)

    def as_xy_float_tuple(self) -> Tuple[float, float]:
        return self.x, self.y


@dataclass
class Vector:
    start: Point
    end: Point

    @property
    def magnitude(self) -> float:
        """
        Calculate the magnitude (length) of the vector.

        Returns:
            float: The magnitude of the vector.
        """
        dx = self.end.x - self.start.x
        dy = self.end.y - self.start.y
        return sqrt(dx**2 + dy**2)

    def cross_product(self, point: Point) -> float:
        """
        Calculate the 2D cross product (also known as the vector product or outer
        product) of the vector and a point, treated as vectors in 2D space.

        Args:
            point (Point): The point to be evaluated, treated as the endpoint of a
                vector originating from the 'start' of the main vector.

        Returns:
            float: The scalar value of the cross product. It is positive if 'point'
                lies to the left of the vector (when moving from 'start' to 'end'),
                negative if it lies to the right, and 0 if it is collinear with the
                vector.
        """
        dx_vector = self.end.x - self.start.x
        dy_vector = self.end.y - self.start.y
        dx_point = point.x - self.start.x
        dy_point = point.y - self.start.y
        return (dx_vector * dy_point) - (dy_vector * dx_point)


@dataclass
class Rect:
    x: float
    y: float