Skip to content

minor_axis_angle

Compute the minor axis angle of a geometry.

Note

The minor axis is the (x,y) endpoints of the longest line that can be drawn through the object whilst remaining perpendicular with the major-axis. Minor axis angle is the angle of the minor axis with respect to the x-axis. - Wirth

Parameters:

Name Type Description Default
geom BaseGeometry

Input shapely geometry object.

required

Returns:

Name Type Description
float float

The angle of the minor axis in degrees.

Source code in src/histolytics/spatial_geom/morphometrics.py
def minor_axis_angle(geom: BaseGeometry) -> float:
    """Compute the minor axis angle of a geometry.

    Note:
        The minor axis is the (x,y) endpoints of the longest line that
        can be drawn through the object whilst remaining perpendicular
        with the major-axis. Minor axis angle is the angle of the minor
        axis with respect to the x-axis.
        - [Wirth](http://www.cyto.purdue.edu/cdroms/micro2/content/education/wirth10.pdf)

    Parameters:
        geom (BaseGeometry):
            Input shapely geometry object.

    Returns:
        float:
            The angle of the minor axis in **degrees**.
    """
    return axis_angle(geom, "minor")