raygeo.geo.shape.point
Individual point operations.
Provides equality testing within a configurable tolerance, midpoint computation between two points, and applying a 4x4 affine transformation matrix to a single point.
Functions
are_points_equal()
are_points_equal(p1: Point3D, p2: Point3D, tolerance: float) -> bool
Check if two 3D points are equal within tolerance.
Returns: True if points are equal within tolerance.
| Parameter | Type | Description |
|---|---|---|
p1 | Point3D | First point (x, y, z). |
p2 | Point3D | Second point (x, y, z). |
tolerance | float | Maximum allowed difference. |
| Returns | bool |
midpoint()
midpoint(p1: Point3D, p2: Point3D) -> Point3D
Get the midpoint between two 3D points.
Returns: Midpoint (x, y, z).
| Parameter | Type | Description |
|---|---|---|
p1 | Point3D | First point (x, y, z). |
p2 | Point3D | Second point (x, y, z). |
| Returns | Point3D |
transform_point()
transform_point(matrix: Sequence[Sequence[float]], x: float, y: float, z: float) -> Point3D
Apply an affine transformation matrix to a 3D point.
Returns: Transformed point (x, y, z).
| Parameter | Type | Description |
|---|---|---|
matrix | Sequence[Sequence[float]] | 4x4 affine transformation matrix. |
x | float | X coordinate. |
y | float | Y coordinate. |
z | float | Z coordinate. |
| Returns | Point3D |