Friday, September 26, 2025
HomeLanguagesPython | Sympy Ellipse.is_tangent() method

Python | Sympy Ellipse.is_tangent() method

In Sympy, the function Ellipse.is_tangent() is used to check whether an Ellipse, LinearEntity or Polygon is tangent to the given Ellipse or not.

Syntax: is_tangent(o)

Parameters: o  an Ellipse, LinearEntity or Polygon

Returns: True if o is tangent to the ellipse, False otherwise.

Raises: NotImplementedError When the wrong type of argument is supplied.

Example #1:




# import sympy and Point, Ellipse, Line
from sympy import Point, Ellipse, Line
  
p0, p1, p2 = Point(0, 0), Point(3, 0), Point(3, 3)
  
# using Line and Ellipse method
e1 = Ellipse(p0, 3, 2)
l1 = Line(p1, p2)
  
# using is_tangent method
e1.is_tangent(l1)


Output:

True

Example #2:




# import sympy and Point, Ellipse, Line
from sympy import Point, Ellipse, Line
  
p0, p1, p2 = Point(0, 0), Point(4, 0), Point(4, 2)
  
# using Line and Ellipse method
e1 = Ellipse(p0, 3, 2)
l1 = Line(p1, p2)
  
# using is_tangent method
e1.is_tangent(l1)


Output:

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

Most Popular

Dominic
32320 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6683 POSTS0 COMMENTS
Nicole Veronica
11854 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11910 POSTS0 COMMENTS
Shaida Kate Naidoo
6795 POSTS0 COMMENTS
Ted Musemwa
7071 POSTS0 COMMENTS
Thapelo Manthata
6755 POSTS0 COMMENTS
Umr Jansen
6762 POSTS0 COMMENTS