Path: utzoo!mnetor!uunet!husc6!tut.cis.ohio-state.edu!spencer From: spencer@tut.cis.ohio-state.edu (Stephen Spencer) Newsgroups: comp.graphics Subject: Re: Algorithm wanted: Circle enclosing points Message-ID: <9572@tut.cis.ohio-state.edu> Date: 4 Apr 88 12:38:45 GMT References: <496@etn-rad.UUCP> Organization: The Ohio State University Dept of Computer and Information Science Lines: 14 Finding the center in x and in y by taking the average is OK, but then finding the distances of all points to the centerpoint using a square root each time could be costly. It would work just as well to NOT take the square root (i.e. just calculate (px-cx)*(px-cx) + (py-cy)*(py-cy) where px,py is a point and cx,cy is the center) when calculating the distances, and then finding the TRUE distance of the largest squared distance by using one square root. This would take (n-1) fewer square roots for n points in the set. -- Stephen Spencer, Graduate Student | The Computer Graphics Research Group | spencer@tut.cis.ohio-state.edu The Ohio State University | spencer@ogg.cgrg.ohio-state.edu 1501 Neil Avenue, Columbus OH 43210 | ICBM: 39'58" N, 83'03" W