what do people use for 2D coordinates?

Tim Rowe tim at remove_if_not_spam.digitig.co.uk
Fri Aug 1 20:02:10 EDT 2003


On 1 Aug 2003 16:37:38 -0700, aayycc88 at hotmail.com (Andy C) wrote:

>You could use tuples or complex numbers (seems like a bit of a hack). 
>I saw somewhere it said that tuples are useful for coordinates.  But I
>haven't found a nice way to add coordinates, since + does
>concatenation on tuples.

Since a complex number is commonly interpreted as a 2D coordinate in
the complex plane, it doesn't look like any sort of a hack to me.
They're likely to have all the properties you want (except, possibly,
easy extensibility into 3D -- but how many languages come with tensor
libraries?)




More information about the Python-list mailing list