Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: Add move_rad to based on radians

  • From the Python: Methods take the examples/oop/methods/shapes.py and add a method called move_rad(dist, angle) that accpets a distance and an angle and moved the point accordingly.
delta_x = dist * cos(angle)
delta_y = dist * sin(angle)