You will write three small functions: the slope of a line through two points, the angle it makes with the positive -axis, and the acute angle between two lines. The checker tests them on many pairs of points.
The idea. , , and for the acute angle between two lines.
Your tasks.
slope(p, q). Return None for a vertical line.inclination(p, q): the angle in degrees, from up to but not including .between(m1, m2): the acute angle in degrees between lines of slopes m1 and m2.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…