skspatial.objects.Plane.intersect_line

Plane.intersect_line(line: Line, **kwargs) Point[source]

Intersect the plane with a line.

The line and plane must not be parallel.

Parameters:
lineLine

Input line.

kwargsdict, optional

Additional keywords passed to Vector.is_perpendicular().

Returns:
Point

The point of intersection.

Raises:
ValueError

If the line and plane are parallel.

References

http://geomalgorithms.com/a05-_intersect-1.html

Examples

>>> from skspatial.objects import Line, Plane
>>> line = Line([0, 0, 0], [0, 0, 1])
>>> plane = Plane([0, 0, 0], [0, 0, 1])
>>> plane.intersect_line(line)
Point([0., 0., 0.])
>>> plane = Plane([2, -53, -7], [0, 0, 1])
>>> plane.intersect_line(line)
Point([ 0.,  0., -7.])
>>> line = Line([0, 1, 0], [1, 0, 0])
>>> plane.intersect_line(line)
Traceback (most recent call last):
...
ValueError: The line and plane must not be parallel.