Wednesday, January 21, 2026
HomeLanguagesPython | Sympy Line.smallest_angle_between method

Python | Sympy Line.smallest_angle_between method

In Sympy, the function smallest_angle_between() is used to return the non-obtuse angle at the intersection of lines.

Syntax: smallest_angle_between(l2)

Parameters: 
 l1: LinearEntity
 l2: LinearEntity

Returns: angle [angle in radians]

Example #1:




# import sympy and Point, Line, pi
from sympy import Point, Line, pi
   
# using Line() method
l1 = Line((0, 0), (1, 0))
l2 = Line((1, 1), (0, 0))
   
# using smallest_angle_between() method
rad = l2.smallest_angle_between(l1)
   
print(rad)


Output:

pi/4

Example #2:




# import sympy and Point, Line, pi
from sympy import Point, Line, pi
   
# using Line() method
l1 = Line((0, 0), (1, 0))
l3 = Line((3, 1), (0, 0))
   
# using smallest_angle_between() method
rad = l3.smallest_angle_between(l1)
   
print(rad)


Output:

acos(3*sqrt(10)/10)
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32475 POSTS0 COMMENTS
Milvus
119 POSTS0 COMMENTS
Nango Kala
6847 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12064 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7220 POSTS0 COMMENTS
Thapelo Manthata
6933 POSTS0 COMMENTS
Umr Jansen
6912 POSTS0 COMMENTS