|
From: SourceForge.net <no...@so...> - 2009-02-13 20:14:20
|
Bugs item #1539595, was opened at 2006-08-13 11:03 Message generated for change (Comment added) made by patrickh You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=437247&aid=1539595&group_id=43735 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: GMTL Group: None >Status: Closed >Resolution: Fixed Priority: 9 Private: No Submitted By: michaln (overeater) Assigned to: Nobody/Anonymous (nobody) Summary: error in LineSegOps.h Initial Comment: File: gmtl-0.4.11/gmtl/LineSegOps.h 51 template< class DATA_TYPE > 52 Point<DATA_TYPE, 3> findNearestPt( const LineSeg<DATA_TYPE>& lineseg, 53 const Point<DATA_TYPE, 3>& pt ) 54 { 55 // result = origin + dir * dot((pt-origin), dir) 56 return ( lineseg.mOrigin + lineseg.mDir * 57 dot(pt - lineseg.mOrigin, lineseg.mDir) ); 58 } This formula holds only for LineSeg of unit length... ...should be: 56 return ( lineseg.mOrigin + lineseg.mDir * 57 ( dot(pt - lineseg.mOrigin, lineseg.mDir) / lengthSquared(lineseg.mDir) ) ); Keep up Your good work :) Michal Nociar, Slovakia ---------------------------------------------------------------------- >Comment By: Patrick Hartling (patrickh) Date: 2009-02-13 14:14 Message: Your change has been applied. Thanks for the bug report! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=437247&aid=1539595&group_id=43735 |