You will write three functions for images and distances, and check them against the rules of the lessons. A point is a tuple (x, y, z). The checker uses several points and planes.
The idea. The image in a plane changes one sign. The image in an axis changes two signs. The distance of a point from an axis uses the two coordinates that are not along that axis.
Your tasks.
image_in_plane(p, plane). The plane is the text "xy", "yz" or "zx". Return the image as a tuple.image_in_axis(p, axis). The axis is the text "x", "y" or "z". Return the image as a tuple.distance_from_axis(p, axis). Return the distance of the point from that axis.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…