Saturday, September 6, 2025
HomeLanguagesPython | Sympy Plane.perpendicular_plane() method

Python | Sympy Plane.perpendicular_plane() method

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, Line3D
from 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 parameters
perpendicularPlane = p1.perpendicular_plane(l1, l2)
  
print(perpendicularPlane)


Output:

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

Example #2:




# import sympy, Point3D and Plane, Line3D
from 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 parameter
perpendicularPlane = p2.perpendicular_plane(l4)
  
print(perpendicularPlane)


Output:

Plane(Point3D(1, 1, 0), (-1, 0, 0))
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32269 POSTS0 COMMENTS
Milvus
82 POSTS0 COMMENTS
Nango Kala
6639 POSTS0 COMMENTS
Nicole Veronica
11803 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11868 POSTS0 COMMENTS
Shaida Kate Naidoo
6752 POSTS0 COMMENTS
Ted Musemwa
7029 POSTS0 COMMENTS
Thapelo Manthata
6704 POSTS0 COMMENTS
Umr Jansen
6721 POSTS0 COMMENTS