Merge: geometry: implement 3D `dist` and improve API
authorJean Privat <jean@pryen.org>
Mon, 29 May 2017 15:07:16 +0000 (11:07 -0400)
committerJean Privat <jean@pryen.org>
Mon, 29 May 2017 15:07:16 +0000 (11:07 -0400)
The main change in this PR is the reimplementation of `Point::dist` and `dist2` to support 3D points, including comparing 2D and 3D points. The double dispatch logic is a bit complex but it works with any receiver.

This PR also tweaks existing services to improve the API and doc:
* Make all attributes of `Point` optional for gradual creation/space allocation. In practice, points are often created with a default value, as a kind of buffer, or with the Z axis at 0.
* Rework `BoxedArray` as a subclass of `Array` to inherit its services (incl. `remove`) while using less code.
* Move the custom `to_s` from the concrete boxes to the interfaces as it is very useful when debugging.

Pull-Request: #2462


Trivial merge