Friday, August 29, 2025
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
32246 POSTS0 COMMENTS
Milvus
80 POSTS0 COMMENTS
Nango Kala
6615 POSTS0 COMMENTS
Nicole Veronica
11787 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11835 POSTS0 COMMENTS
Shaida Kate Naidoo
6731 POSTS0 COMMENTS
Ted Musemwa
7011 POSTS0 COMMENTS
Thapelo Manthata
6685 POSTS0 COMMENTS
Umr Jansen
6699 POSTS0 COMMENTS