Chris Angelico wrote:
I'm not sure there's any distinction between a "point" and a "vector from the origin to a point".
They transform differently. For example, translation affects a point, but makes no difference to a vector. There are two ways of dealing with that. One is to use vectors to represent both and have two different operations, "transform point" and "transform vector". The other is to represent them using different types and have one operation that does different things depending on the type. The advantage of the latter is that you can't accidentally apply the wrong operation, e.g. transform_point on something that's actually a vector. (There's actually a third way -- use homogeneous coordinates and represent points as (x, y, z, 1) and vectors as (x, y, z, 0). But that's really a variation on the "different types" idea.) -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com