From: <ro...@us...> - 2012-05-02 11:40:28
|
Revision: 1988 http://nsclspectcl.svn.sourceforge.net/nsclspectcl/?rev=1988&view=rev Author: ron-fox Date: 2012-05-02 11:40:21 +0000 (Wed, 02 May 2012) Log Message: ----------- issue 107 - Fix errors in 2-d integration (edge table maker was using incorrect inverse line function). Modified Paths: -------------- branches/3.3-008-dev/SpecTcl/IntegrateCommand.cpp Modified: branches/3.3-008-dev/SpecTcl/IntegrateCommand.cpp =================================================================== --- branches/3.3-008-dev/SpecTcl/IntegrateCommand.cpp 2012-05-01 19:19:33 UTC (rev 1987) +++ branches/3.3-008-dev/SpecTcl/IntegrateCommand.cpp 2012-05-02 11:40:21 UTC (rev 1988) @@ -654,9 +654,13 @@ ((float)m_xTop - (float)m_xBottom); } + // Use the point slope form to locate the x position of + // a point on the edge specifically: + // y-y0 = m(x-x0) => x = (y-y0)/m + x0 Arbitrarily use m_xTop,m_yTop as x0/y0. + virtual void addEdgePoint(vector<int>& existingPoints, int height) { if ((height >= m_yBottom) && (height <= m_yTop)) { - int point = (int)(m_xBottom + m_slope*(height - m_xBottom)); + int point = (int)(m_xTop + (height - m_yTop)/m_slope); existingPoints.push_back(point); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |