Python | Sympy Plane.projection_line() method

In Sympy, the function Plane.projection_line() is used to project the given line onto the given plane through the normal plane containing the line.

Syntax: Plane.projection_line(line)

Parameters:
 line: LinearEntity or LinearEntity3D

Returns: Point3D, Line3D, Ray3D or Segment3D

Example #1:

filter_none

edit
close

play_arrow

link
brightness_4
code

# import sympy and Plane, Line, Line3D, Point, Point3D
from sympy import Plane, Line, Line3D, Point, Point3D
  
p = Line(Point(1, 2), Point(2, 3))
  
# using Plane()
p1 = Plane(Point3D(1, 2, 3), normal_vector =(1, 0, 1))
  
# using projection_line()
projectionLine = p1.projection_line(p)
  
print(projectionLine)

chevron_right


Output:

Line3D(Point3D(5/2, 2, 3/2), Point3D(3, 3, 1))

Example #2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# import sympy and Plane, Line, Line3D, Point, Point3D
from sympy import Plane, Line, Line3D, Point, Point3D
  
p = Line3D(Point3D(1, 2, 3), Point(0, 0, 0))
  
# using Plane()
p2 = Plane(Point3D(1, 1, 1), normal_vector =(0, 0, 0))
  
# using projection_line()
projectionLine = p2.projection_line(p)
  
print(projectionLine)

chevron_right


Output:

Line3D(Point3D(1, 2, 3), Point3D(2, 0, 2))
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.