Tuesday, October 7, 2025
HomeLanguagesPython | Sympy Ellipse.rotate() method

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, Ellipse
from sympy import Ellipse, pi
  
# using Ellipse() method
e1 = Ellipse((1, 0), 2, 1)
  
# using rotate() method
e1.rotate(pi / 2)
  
print(e1)


Output:

Ellipse(Point2D(0, 1), 1, 2)

Example #2:




# import sympy and pi, Ellipse
from sympy import Ellipse, pi
  
# using Ellipse() method
e2 = Ellipse((1, 0), 2, 1)
  
# using rotate() with given point method
e2.rotate(pi / 2, (1, 2))
  
print(e2)


Output:

Ellipse(Point2D(3, 2), 1, 2)
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32340 POSTS0 COMMENTS
Milvus
86 POSTS0 COMMENTS
Nango Kala
6709 POSTS0 COMMENTS
Nicole Veronica
11874 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11937 POSTS0 COMMENTS
Shaida Kate Naidoo
6832 POSTS0 COMMENTS
Ted Musemwa
7091 POSTS0 COMMENTS
Thapelo Manthata
6781 POSTS0 COMMENTS
Umr Jansen
6785 POSTS0 COMMENTS