Court Geometry
The court module defines the dimensions, landmarks, and coordinate system of an official padel court. On this page, we'll dive into the different classes and methods you can use to interact with court geometry programmatically.
The CourtDimensions model
The CourtDimensions dataclass houses the official measurements of the court. All units are expressed in meters.
Properties
- Name
length- Type
- float
- Description
The total length of the padel court.
- Name
width- Type
- float
- Description
The total width of the padel court.
The PadelCourt model
The PadelCourt class is the main geometry model. It uses a centralized coordinate system where the origin (0.0, 0.0) is exactly at the center of the court (at the net). The X axis represents the width, and the Y axis represents the length.
Properties
- Name
dimensions- Type
- CourtDimensions
- Description
An instance of the
CourtDimensionsclass containing the physical measurements.
Standard Initialization
This class method allows you to easily instantiate a PadelCourt using the standard measurements established by the International Padel Federation (FIP).
By default, an FIP court is 20.0m in length and 10.0m in width.
Instantiation
from padelkit import PadelCourt
court = PadelCourt.fip_standard()
Output structure
PadelCourt(
dimensions=CourtDimensions(length=20.0, width=10.0)
)
Get a landmark coordinate
This method allows you to retrieve the exact (x, y) coordinates of a specific standard landmark on the court.
Required arguments
- Name
name- Type
- Landmark | str
- Description
The name of the landmark. This can be an instance of the
LandmarkEnum (e.g.,Landmark.NET_CENTER) or its string equivalent (e.g.,"NET_CENTER").
Usage
from padelkit import PadelCourt
court = PadelCourt.fip_standard()
net_center = court.point("NET_CENTER")
Output
(0.0, 0.0)
List all landmarks
This method returns a dictionary containing all the standardized 2D positions of the court landmarks. It's useful if you need to draw the court or access multiple points at once.
Usage
from padelkit import PadelCourt
court = PadelCourt.fip_standard()
all_points = court.landmarks_2d()
Output (abridged)
{
"CENTER": [0.0, 0.0],
"NET_LEFT": [-5.0, 0.0],
"NET_RIGHT": [5.0, 0.0],
"TOP_LEFT": [-5.0, -10.0],
"TOP_RIGHT": [5.0, -10.0],
"BOTTOM_LEFT": [-5.0, 10.0],
"BOTTOM_RIGHT": [5.0, 10.0]
}