From 55682aa484f29830eb230cf4f35fa995eeed9c89 Mon Sep 17 00:00:00 2001 From: unexcellent <> Date: Fri, 8 Nov 2024 14:46:29 +0100 Subject: [PATCH] feat: add Area --- quantio/quantities.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/quantio/quantities.py b/quantio/quantities.py index 6399764..7cfc22c 100644 --- a/quantio/quantities.py +++ b/quantio/quantities.py @@ -3,6 +3,21 @@ from ._quantity_base import _QuantityBase +class Area(_QuantityBase): + """The two-dimensional extent of an object.""" + + _UNIT_CONVERSION: dict[str, float] = { + "square_miles": 1609.34**2, + "square_kilometers": 10 ** (3 * 2), + "square_meters": 10**0, + "square_feet": 0.3048**2, + "square_inches": 0.0254**2, + "square_centimeters": 10 ** (-2 * 2), + "square_millimeters": 10 ** (-3 * 2), + "square_micrometers": 10 ** (-6 * 2), + } + + class Length(_QuantityBase): """The one-dimensional extent of an object or the distance between two points."""