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:

 # import sympy, Point3D and Plane, Line3Dfrom sympy import Point3D, Plane, Line3D  l1, l2 = Point3D(0, 0, 0), Point3D(1, 2, 3)z1 = (1, 0, 1)  # using Plane()p1 = Plane(a, normal_vector = z1)  # using perpendicular_plane() with two parametersperpendicularPlane = p1.perpendicular_plane(l1, l2)  print(perpendicularPlane)

Output:

Plane(Point3D(0, 0, 0), (2, 2, -2))

Example #2:

 # import sympy, Point3D and Plane, Line3Dfrom sympy import Point3D, Plane, Line3D  l3, l4 = Point3D(0, 0, 0), Point3D(1, 1, 0)z2 = (0, 1, 1)  # using Plane()p2 = Plane(l3, normal_vector = z2)  # using perpendicular_plane() with one parameterperpendicularPlane = p2.perpendicular_plane(l4)  print(perpendicularPlane)

Output:

Plane(Point3D(1, 1, 0), (-1, 0, 0))

My Personal Notes arrow_drop_up