skspatial.objects.Line.is_coplanar

Line.is_coplanar(other: skspatial.objects.line.Line, **kwargs: float) bool[source]

Check if the line is coplanar with another.

Parameters
otherLine

Other line.

kwargsdict, optional

Additional keywords passed to numpy.linalg.matrix_rank()

Returns
bool

True if the line is coplanar; false otherwise.

Raises
TypeError

If the input is not a line.

References

http://mathworld.wolfram.com/Coplanar.html

Examples

>>> from skspatial.objects import Line
>>> line_a = Line(point=[0, 0, 0], direction=[1, 0, 0])
>>> line_b = Line([-5, 3, 0], [7, 1, 0])
>>> line_c = Line([0, 0, 0], [0, 0, 1])
>>> line_a.is_coplanar(line_b)
True
>>> line_a.is_coplanar(line_c)
True
>>> line_b.is_coplanar(line_c)
False

The input must be another line.

>>> from skspatial.objects import Plane
>>> line_a.is_coplanar(Plane(line_a.point, line_a.vector))
Traceback (most recent call last):
...
TypeError: The input must also be a line.