reflect_line_plane

compas.geometry.reflect_line_plane(line, plane, tol=None)[source]

Bounce a line of a reflection plane.

Parameters:
line[point, point] | compas.geometry.Line

Two points defining the line.

plane[point, vector] | compas.geometry.Plane

Base point and normal vector of the plane.

tolfloat, optional

A tolerance for finding the intersection between the line and the plane. Default is TOL.absolute().

Returns:
tuple[[float, float, float], [float, float, float]]

The reflected line defined by the intersection point of the line and plane and the mirrored start point of the line with respect to a line perpendicular to the plane through the intersection.

Notes

The direction of the line and plane are important. The line is only reflected if it points towards the front of the plane. This is true if the dot product of the direction vector of the line and the normal vector of the plane is smaller than zero.

Examples

>>> plane = [0, 0, 0], [0, 1, 0]
>>> line = [-1, 1, 0], [-0.5, 0.5, 0]
>>> reflect_line_plane(line, plane)
([0.0, 0.0, 0.0], [1.0, 1.0, 0.0])