Each line is written as . You will sort pairs of lines into the three cases without drawing them. Cross-multiplying the ratios avoids dividing by zero.
The idea. is the same as . If that fails, the lines cross once. If it holds, they are one line when and as well, and parallel otherwise.
Your tasks.
crosses, return True when .kind, return "one", "none" or "many".kinds with the kind of each pair in pairs, in order.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…