mrdja.geometry.get_intersection_point_of_line_with_plane

mrdja.geometry.get_intersection_point_of_line_with_plane(line: ndarray, plane: ndarray) ndarray | None[source]

Get the intersection point of a line with a plane. If it is parallel, return None.

Parameters:
  • line (np.ndarray) – Line described as two points.

  • plane (np.ndarray) – Plane described as Ax + By + Cz + D = 0.

Returns:

Intersection point.

Return type:

Optional[np.ndarray]

Example:

>>> import mrdja.geometry as geom
>>> import numpy as np 
>>> import mrdja.drawing as drawing
>>> line = np.array([[0, 0, 0], [1, 1, 1]])
>>> plane = np.array([0, 0, 1, -3])
>>> intersection_point = geom.get_intersection_point_of_line_with_plane(line, plane)
>>> intersection_point
array([3., 3., 3.])
>>> drawing.draw_line_extension_to_plane(line, plane)

drawing_draw_line_extension_to_plane_example