Thursday, October 9, 2025
HomeLanguagesPython | Sympy Line.is_parallel() method

Python | Sympy Line.is_parallel() method

In Sympy, the function is_parallel() is used to check whether the two linear entities are parallel or not.

Syntax: Line.is_parallel(l2)

Parameters:
 l1: LinearEntity
 l2: LinearEntity

Returns:
 True: if l1 and l2 are parallel,
 False: otherwise.

Example #1:




# import sympy and Point, Line
from sympy import Point, Line
  
p1, p2 = Point(0, 0), Point(1, 1)
p3, p4 = Point(3, 4), Point(6, 7)
  
l1, l2 = Line(p1, p2), Line(p3, p4)
  
# using is_parallel() method
isParallel = Line.is_parallel(l1, l2)
  
print(isParallel)


Output:

True

Example #2:




# import sympy and Point, Line
from sympy import Point, Line
  
p1, p2 = Point(0, 0), Point(1, 1)
p3, p4 = Point(3, 4), Point(6, 6)
  
l1, l2 = Line(p1, p2), Line(p3, p4)
  
# using is_parallel() method
isParallel = Line.is_parallel(l1, l2)
  
print(isParallel)


Output:

False
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32346 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6714 POSTS0 COMMENTS
Nicole Veronica
11877 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11940 POSTS0 COMMENTS
Shaida Kate Naidoo
6835 POSTS0 COMMENTS
Ted Musemwa
7094 POSTS0 COMMENTS
Thapelo Manthata
6789 POSTS0 COMMENTS
Umr Jansen
6791 POSTS0 COMMENTS