Use Python - Rotations Instruction : Create the following function and call it to the main function. rotate point(point, pivot, angle) It rotates a point (two-float tuple) about a pivot (two-float...



Use
Python - Rotations




Instruction:

Create the following function and call it to the main function.



rotate point(point, pivot, angle)



  • It rotates a
    point
    (two-float tuple) about a
    pivot
    (two-float tuple) by a given
    angle
    of rotation (float, degrees).

  • It returns the floating-point coordinates of the rotated point.



Notes:



  • Remember to convert the angle in degrees toradianswithin the function.

  • You are only allowed to usecos, sin,andpifrom the math library.



Examples of Output (with varying angles):



  1. Given:
    a = rotate_point((100, 100), (100, 80), 0)
    Output:
    (100, 80)

  2. Given:
    a = rotate_point((100, 100), (100, 80), 90)
    Output:
    (120, 100)

  3. Given:
    a = rotate_point((100, 100), (100, 80), 180)
    Output:
    (100, 120)



Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here