Geometries
- LENGTH_UNIT = 1.0
Base unit for lengths. Here to avoid numerical precision issues if dealing with too little numbers.
- class JGEXPoint(**data)
Bases:
BaseModel
Numerical point.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- x: float
- y: float
- angle()
- Return type:
float
- close_enough(point)
- Return type:
bool
- distance(p)
- Return type:
float
- distance2(p)
- Return type:
float
- dot(other)
- Return type:
float
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class JGEXGeometry
Bases:
ABC
- class JGEXLine(p1=None, p2=None, coefficients=None)
Bases:
JGEXGeometry
Numerical line.
- distance(p)
- Return type:
float
- is_parallel(other)
- Return type:
bool
- is_perp(other)
- Return type:
bool
- is_same(other)
- Return type:
bool
- point_at(x=None, y=None)
Infer the point on the line by its x and/or y coordinate(s)
- Return type:
Optional
[JGEXPoint
]
- diff_side(p1, p2)
- Return type:
bool
- same_side(p1, p2)
- Return type:
bool
- sample_within(points, *, trials=5, rng)
Sample a point on the line within the boundary of existing points.
- Return type:
- angle()
- Return type:
float
- angle_to(other)
- Return type:
float
- class JGEXCircle(center=None, radius=None, p1=None, p2=None, p3=None)
Bases:
JGEXGeometry
Numerical circle.
- solve_quad(a, b, c)
Solve a x^2 + bx + c = 0.
- Return type:
tuple
[float
,...
]
- intersect(a, b)