Python | Sympy Ellipse.is_tangent() method
Last Updated :
30 Jan, 2020
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:
from sympy import Point, Ellipse, Line
p0, p1, p2 = Point( 0 , 0 ), Point( 3 , 0 ), Point( 3 , 3 )
e1 = Ellipse(p0, 3 , 2 )
l1 = Line(p1, p2)
e1.is_tangent(l1)
|
Output:
True
Example #2:
from sympy import Point, Ellipse, Line
p0, p1, p2 = Point( 0 , 0 ), Point( 4 , 0 ), Point( 4 , 2 )
e1 = Ellipse(p0, 3 , 2 )
l1 = Line(p1, p2)
e1.is_tangent(l1)
|
Output:
False
Share your thoughts in the comments
Please Login to comment...