[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Code: Center of Triangle



Patrick Mullen wrote:
Yeah, shouldn't it be math.sqrt(dist)?

Although you might want to just return the distance^2 so the user can decide whether a sqrt is necessary or not.

Yes -- often you don't need the sqrt, e.g.
if you just want to compare two distances.

Either way, the value you're calling 'dist'
should really be called 'distsq' or something.

--
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing@xxxxxxxxxxxxxxxx	   +--------------------------------------+