[Lazarus] ComparePoints func

Michael Van Canneyt michael at freepascal.org
Wed Jul 26 23:02:53 CEST 2017



On Wed, 26 Jul 2017, Reimar Grabowski via Lazarus wrote:

> On Wed, 26 Jul 2017 18:53:34 +0100
> Graeme Geldenhuys via Lazarus <lazarus at lists.lazarus-ide.org> wrote:
>
>> On 2017-07-26 17:27, Alexey via Lazarus wrote:
>> > Hm, in my app Int makes sense: i need to compare Points in binary
>> > search, and see: >, <, =. 
>> 
>> Ever heard of Manhatten Length? That would be a more logical approach. 
> If a metric would be more logical (I don't know why exactly it should be but whatever) the euclidean metric would be even more logical, wouldn't it?
>
>> It is a commonly used length calculation for points.
> That sounds horrible.
> Is length really used like this?
> The length of two points???
> Metrics are distance functions.
>
>>    http://en.wikipedia.org/wiki/Taxicab_geometry
> Any 2 dimensional metric can be used.
> But it may totally not be the thing the TC needs as the metric conditions may not be desirable in his context.
>
> The point is (and Michael made it already) that there is no definition of how to compare points. You have quite a lot of options and the current problem determines which function to use.
> Therefore it makes no sense to introduce a general ComparePoints-function.

Exactly.

Michael.


More information about the Lazarus mailing list