Dmitry. A. Ashkadov wrote:
I found out that class Rectangle contains two different finctions getWidth() and GetWidth(). The first returns wrong value.
Hi Dmitry - yes, the two different methods are surely confusing. As for the "wrong value", that very much depends on the mental model of rectangles you're using. In a discrete geometry world (aka "pixel"), the GetWidth() is correct. In a continuous geometry world (aka "euclidean plane"), getWidth() is right. This fundamental, conceptual difference is the historical reason for the two methods (admittedly, not a very clean solution to the problem). Cheers, -- Thorsten
Attachment:
pgpYgTeN26tPk.pgp
Description: PGP signature