Skip to main content

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.

ParameterTypeDescription
p1Point3DFirst point (x, y, z).
p2Point3DSecond point (x, y, z).
tolerancefloatMaximum allowed difference.
Returnsbool

midpoint()

midpoint(p1: Point3D, p2: Point3D) -> Point3D

Get the midpoint between two 3D points.

Returns: Midpoint (x, y, z).

ParameterTypeDescription
p1Point3DFirst point (x, y, z).
p2Point3DSecond point (x, y, z).
ReturnsPoint3D

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).

ParameterTypeDescription
matrixSequence[Sequence[float]]4x4 affine transformation matrix.
xfloatX coordinate.
yfloatY coordinate.
zfloatZ coordinate.
ReturnsPoint3D