Kotlin-Polytech / KotlinAsFirst

Задачи для онлайн-курса "Котлин как первый язык программирования"
Creative Commons Attribution Share Alike 4.0 International
74 stars 115 forks source link

Circle.contains and minContainingCircle consistency #71

Closed gagarski closed 4 years ago

gagarski commented 5 years ago

The root of the problem is that circleByDiameter does not always contains diameter.begin and diameter.end.

This can create two bad situations in minContainingCircle:

I honestly do not know how to solve it. One way would be to implement #68. The other would be to add explicit hints about consistency for contains and minContainingCircle.

gagarski commented 5 years ago

It seems like choosing the point furthest from center to calculate the radius in circleByDiameter solves the problem, however this is quite confusing: both points should have the same distance to center.

mglukhikh commented 5 years ago

As an alternative solution, see also #68 (lesson8.task1.Hex). I suggest just to reject the issue, so the students who do not want to struggle with Doubles could struggle with Hexes instead. Or you can add explicit hints about consistency you suggest above. // cc @gagarski

mglukhikh commented 4 years ago

I'm closing this issue as "unclear".