Hello Sotiris.<br><br>2009/8/13 Σωτήρης Παπαντωνίου &lt;<a href="mailto:sotos.enveng@gmail.com">sotos.enveng@gmail.com</a>&gt;:<br>&gt; Hello again with a new question,<br>&gt;  <br>&gt; the pool I am trying to simulate has a bottom that it&#39;s depth varies. This<br>
&gt; means that i can not use the poolcoords.cal formula as it is and i need to<br>&gt; make some necessary changes.<br><br>I don&#39;t think you need to change anything in this formula. It returns<br>the bin number for a point (Px,Py) based on the x and y resolution.<br>
The &quot;depth&quot; of the plane is not taken into account. If you would add<br>another component you would split the 2-d array into a 3-d array.<br>I don&#39;t think that&#39;s what you want to do.<br><br>&gt; The part of formula i don&#39;t understand, but i<br>
&gt; think can not work as it is, is the following:<br>&gt;<br>&gt; &quot;floor_bin = floor(FloorXres*(Px - FloorOrigX)/FloorWidth) +<br>&gt; floor(FloorYres*(1 - (Py - FloorOrigY)/FloorLength))*FloorXres;&quot;<br><br>This formula returns the number of the bin for the particular<br>
&quot;tile&quot; in the Xres (columns) * Yres (rows) grid.<br><br>floor_bin = column position + ( row position * columns) <br><br>floor() is the math formula to return the next smaller integer number.<br><br>It&#39;s easy to understand if you replace all the variables with<br>
actual values. Example:<br><br>FloorXres = 13<br>FloorYres = 17<br>FloorOrigX = 0<br>FloorOrigY = 0<br>FloorWidth = 26<br>FloorLength = 34<br><br>Px = 5.67<br>Py = 12.34<br><br>floor_bin = floor( 13 * ( 5.67 - 0 ) / 26 ) + floor( 17 * ( 1 - ( 12.34 - 0 ) / 34 ) ) * 13<br>
<br>floor_bin = floor( 13 * rel X position ) + floor ( 17 * ( 1 - rel Y postion) ) * 13<br><br>&gt; In this formula 3 more parameters must be added in my opinion: FloorOrigZ,<br>&gt; FloorZres, FloorDepth.<br><br>Z is not taken into account here.<br>
<br>&gt; The role of the this formula is to calculate how many points (bins) should<br>&gt; be used for calculating how much energy falls on them,<br><br>Not &quot;how many&quot; bins but &quot;which&quot; bin. The &quot;how many&quot; is set by Xres and Yres.<br>
<br>&gt; If someone can explain how the specific formula works [ floor(...) , Px, Py<br>&gt; ], or give me directly a new one with the parameters of depth in it, I<br>&gt; whould be grateful.<br><br>I hope you can go on with the explanation above. If your floor slopes down<br>
you might have adjust the area of the floor relative to a horizontal plane.<br>But that should be all.<br><br><br>Thomas<br><br><br>