Bug in Geometry class

From: Douglas Kenneth Hasell (hasell@MIT.EDU)
Date: Wed Feb 08 2006 - 12:51:47 EST


Hi,

        If anyone is using my Geometry class which defines the classes
Vector, Point, Line, Plane and operations between them; I have
discovered a bug in one of the constructors for Line.

        Two of the many ways a line can be defined are:

                1. by a point on the line and a vector describing the direction of
the line, or
                2. by two points on the line

        In my class Line the first method as a constructor works. The
second one can fail. The failure mechanism is because the
representation of a Point is as a Vector so without strong type
casting Line( Point1, Point2) is interprested as Line(Point1,Vector
(Point2)) where it takes Point2 as a Vector describing the direction
for the line.

        I will fix this and release an upgrade but the correct way to code
this would be as:

                Line( Point1, Point2-Point1)

        Sorry for any inconvenience.

                                                                         
                       Cheers,
                                                                         
                                       Douglas

26-415
M.I.T. Tel:
+1 (617) 258-7199
77 Massachusetts Avenue Fax: +1
(617) 258-5440
Cambridge, MA 02139, USA E-mail:
hasell@mit.edu



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:33 EST