Python | Sympy Plane.perpendicular_plane() method
Last Updated :
22 Apr, 2020
In Sympy, the function
Plane.perpendicular_plane()
is used to return a perpendicular plane passing through the given points. If the direction ratio between the points is the same as the Plane’s normal vector then, to select from the infinite number of possible planes, a third point will be chosen on the z-axis (or the y-axis if the normal vector is already parallel to the z-axis).
If less than two points are given they will be supplied as follows: if no point is given then pt1 will be self.p1; if a second point is not given it will be a point through pt1 on a line parallel to the z-axis (if the normal is not already the z-axis, otherwise on the line parallel to the y-axis).
Syntax: Plane.perpendicular_plane(pts)
Parameters:
pts: 0, 1 or 2 Point3D
Returns: Plane
Example #1:
from sympy import Point3D, Plane, Line3D
l1, l2 = Point3D( 0 , 0 , 0 ), Point3D( 1 , 2 , 3 )
z1 = ( 1 , 0 , 1 )
p1 = Plane(a, normal_vector = z1)
perpendicularPlane = p1.perpendicular_plane(l1, l2)
print (perpendicularPlane)
|
Output:
Plane(Point3D(0, 0, 0), (2, 2, -2))
Example #2:
from sympy import Point3D, Plane, Line3D
l3, l4 = Point3D( 0 , 0 , 0 ), Point3D( 1 , 1 , 0 )
z2 = ( 0 , 1 , 1 )
p2 = Plane(l3, normal_vector = z2)
perpendicularPlane = p2.perpendicular_plane(l4)
print (perpendicularPlane)
|
Output:
Plane(Point3D(1, 1, 0), (-1, 0, 0))
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...