'Rotate region - GEE

Is there a way to rotate region or a rectangle in GEE?

I am working on procedural extracting some satellite data from google earth engine. It works pretty well and I am defining square regions that are then exported. Right now, all the rectangles that I define are aligned with the map, because the simplest way to define a square in a specific distance on the ground is to use the .buffer function and then the .bounds function, but the bounds are then always aligned with the map (up is north). I would like to have images cutouts that are not aligned with the map. Both python and java-script answers are welcome.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source