Related Articles

Related Articles

Python | Sympy Plane.projection() method
  • Last Updated : 22 Apr, 2020
In Sympy, the function Plane.projection() is used project the given point onto the given plane along the plane normal which means, the projection is along the normal vector direction of the plane.

Syntax:  Plane.projection(pt)

Parameters: 
 pt: Point or Point3D

Returns: Point3D

Example #1:

filter_none

edit
close

play_arrow

link
brightness_4
code

# import sympy and Plane, Point, Point3D
from sympy import Plane, Point, Point3D
  
p = Point(2, 2)
  
# using Plane()
p1 = Plane(Point3D(1, 2, 3), normal_vector =(0, 1, 1))
  
# using projection()
projectionPoint = p1.projection(p)
  
print(projectionPoint)

chevron_right


Output:

Point3D(2, 7/2, 3/2)

Example #2:

filter_none

edit
close

play_arrow

link
brightness_4
code

# import sympy and Plane, Point, Point3D
from sympy import Plane, Point, Point3D
  
p = Point3D(2, 2, 2)
  
# using Plane()
p1 = Plane(Point3D(1, 2, 3), normal_vector =(0, 1, 1))
  
# using projection()
projectionPoint = p1.projection(p)
  
print(projectionPoint)

chevron_right


Output:

Point3D(2, 5/2, 5/2)

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :