Python | Sympy Ellipse.rotate() method
In Sympy, the function
rotate() is used to rotate the ellipse counterclockwise about the given point by the given angle.Syntax: Ellipse.rotate(angle=0, pt=None) Parameters: angle: in radian pt: point about which ellipse is rotated in counterclockwise. Returns: rotated ellipse
Example #1:
# import sympy and pi, Ellipsefrom sympy import Ellipse, pi # using Ellipse() methode1 = Ellipse((1, 0), 2, 1) # using rotate() methode1.rotate(pi / 2) print(e1) |
Output:
Ellipse(Point2D(0, 1), 1, 2)
Example #2:
# import sympy and pi, Ellipsefrom sympy import Ellipse, pi # using Ellipse() methode2 = Ellipse((1, 0), 2, 1) # using rotate() with given point methode2.rotate(pi / 2, (1, 2)) print(e2) |
Output:
Ellipse(Point2D(3, 2), 1, 2)
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.


