You will write three functions for a shift of origin. A curve is given by its six coefficients , in the form .
The idea. After the shift to , the new first-degree coefficients are and . The centre makes both zero, and it exists when .
Your tasks.
shift(P, O2). Return the new coordinates of the point P when the origin moves to O2.new_linear(a, h, b, g, f, al, be). Return (g', f').centre(a, h, b, g, f). Solve the two centre equations with Cramer's rule, or return None when .Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…