[Flightgear-devel] RFC: fixing sgdClosestPointToLineDistSquared() FPE

2002-02-19 Thread Cameron Moore
We have a 'divide by zero' situation in simgear/math/vector.cxx, but I'm sure what the right fix is. Here's the offending routine: // Given a point p, and a line through p0 with direction vector d, // find the shortest distance (squared) from the point to the line double

Re: [Flightgear-devel] RFC: fixing sgdClosestPointToLineDistSquared()FPE

2002-02-19 Thread Alex Perry
We have a 'divide by zero' situation in simgear/math/vector.cxx, but I'm sure what the right fix is. Here's the offending routine: Nah. double dd = sgdScalarProductVec3(d, d); double tmp = ud / dd; Personally, I'd stick an assert in there that dd must always be positive. It is