Hello Sotiris.<br><br>2009/8/13 Σωτήρης Παπαντωνίου <<a href="mailto:sotos.enveng@gmail.com">sotos.enveng@gmail.com</a>>:<br>> Hello again with a new question,<br>> <br>> the pool I am trying to simulate has a bottom that it's depth varies. This<br>
> means that i can not use the poolcoords.cal formula as it is and i need to<br>> make some necessary changes.<br><br>I don'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 "depth" 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't think that's what you want to do.<br><br>> The part of formula i don't understand, but i<br>
> think can not work as it is, is the following:<br>><br>> "floor_bin = floor(FloorXres*(Px - FloorOrigX)/FloorWidth) +<br>> floor(FloorYres*(1 - (Py - FloorOrigY)/FloorLength))*FloorXres;"<br><br>This formula returns the number of the bin for the particular<br>
"tile" 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'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>> In this formula 3 more parameters must be added in my opinion: FloorOrigZ,<br>> FloorZres, FloorDepth.<br><br>Z is not taken into account here.<br>
<br>> The role of the this formula is to calculate how many points (bins) should<br>> be used for calculating how much energy falls on them,<br><br>Not "how many" bins but "which" bin. The "how many" is set by Xres and Yres.<br>
<br>> If someone can explain how the specific formula works [ floor(...) , Px, Py<br>> ], or give me directly a new one with the parameters of depth in it, I<br>> 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>