[Lazarus] ComparePoints func

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed Jul 26 19:53:34 CEST 2017


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. 
It is a commonly used length calculation for points.

   http://en.wikipedia.org/wiki/Taxicab_geometry


The interface as in fpGUI's TfpgPoint:

 
https://github.com/graemeg/fpGUI/blob/develop/src/corelib/fpg_base.pas#L164..L165


The implementations:

 
https://github.com/graemeg/fpGUI/blob/develop/src/corelib/fpg_base.pas#L2021..L2029



Regards,
   Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list