You will write three functions that solve the problem of the lesson in exact fractions. The checker uses the four points of the lesson.
The idea. For two points and , is the linear equation . Three such equations, for , and with the same , have one solution when the four points are not in one plane. Cramer's rule solves them: each unknown is a ratio of two determinants.
Your tasks.
det3(m). Return the determinant of a matrix given as three rows.solve3(m, v). Solve by Cramer's rule and return the three values as Fraction numbers.equidistant(a, b, c, d). Build the three equations and return the point that is equally far from the four points.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…