Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ ¹ ² ³ °
 

You are not logged in. #1 20121207 07:53:53
Distance to the wall of the boxThe problem: #2 20121207 17:23:53
Re: Distance to the wall of the boxHi my friend. If you are allowed to use the absolute value operator, I do believe an elegant solution will arrive. For starters, let's couple together the dbottom with the dtop in an expression to find the one that is positive. And also let's couple together the dleft with the dright in an expression to find the one that is positive meaning nonnegative. In these two cases, we simply need a "maximum finder" equation that uses the absolute value signs. After these two terms are resolved, they can be embedded in the larger single equation in which the "minimum of two values" is found, and that is the answer. Now let me give you an idea as to how one would find the max value of two numbers with the absolute value sign. See next post for more details... igloo myrtilles fourmis #3 20121207 17:29:47
Re: Distance to the wall of the boxmax value of a and b = (a + b + a  b) / 2 igloo myrtilles fourmis #4 20121207 18:11:58
Re: Distance to the wall of the boxHere's an awkward way to avoid absolute value signs: igloo myrtilles fourmis #5 20121208 04:42:15
Re: Distance to the wall of the box
Yes, I am allowed to use min() and max() functions, and right now I actually have an equation similar to the one you showed here. It works perfectly but I still believe there is a way to avoid individual calculations of these distances. 