Newsgroups: comp.lang.c++,comp.object,comp.theory,comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel-eecis!gatech!csulb.edu!hammer.uoregon.edu!news-xfer.netaxs.com!news.mathworks.com!howland.erols.net!newsxfer.itd.umich.edu!uunet!in3.uu.net!128.100.1.3!utcsri!info.ecf!doylep
From: doylep@ecf.toronto.edu (Patrick Doyle)
Subject: Re: The Solution. Re: Opinions on Ellipse-Circle dilemma?
Sender: news@ecf.toronto.edu (News Administrator)
Message-ID: <E658L1.4LC@ecf.toronto.edu>
Date: Tue, 25 Feb 1997 05:29:24 GMT
Distribution: inet
X-Nntp-Posting-Host: skule.ecf
Organization: University of Toronto, Engineering Computing Facility
Lines: 41
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:249993 comp.object:61567 comp.theory:18177 comp.lang.smalltalk:52141

In article <01bc2298$53af44e0$371883cc@beast.advancedsw.com>,
Roger T. <roger@advancedsw.com> wrote:
>
>Robert C. Martin <rmartin@oma.com> wrote in article
><rmartin-2102971353100001@pool10-012.wwa.com>...
>> 
>> Consider the problem of calculating the the circle that intersects three
>> points.  This would be trivial if one had a circle class, but would be
>> extremely difficult if one had only an Elipse or Conic class. 
>
>?? There is no solution for calculating a circle that intersects 3
>arbitrary points. For a circle you can only solve for 2 arbitrary points. 
>You need an ellipse for 3 arbitrary points.

  Um, you sure about this?  Unless the three points are collinear, there is
a unique circle that passes through all of them.  You can find it like this:

 1. Pick two of the points.  For the circle that passes through these points,
    the line joining them is a secant.  Its perpendicular bisector must pass
    through the center of the circle.
 2. Same for another pair.
 3. The intersection of these two bisectors is the center of the circle.

  If the points are collinear, the bisectors don't cross, of course.

  If you give me two points, I can find any number of circles through them,
from the one where the points are on the same diameter, upwards to one
approaching a straight line through the points.

>I think you can if you generalize across the entire range of possible
>system implementations. In general I think that not having a Circle class
>cohabitating in an inheritance relation with an Ellipse class results in a
>better system.

  Of course, it depends on the system, but I'd tend to agree.

 -PD
-- 
--
Patrick Doyle
doylep@ecf.utoronto.ca
