Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
| |
|
|
You are not logged in. #1 2012-12-07 07:53:53
Distance to the wall of the boxThe problem: #2 2012-12-07 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 non-negative. 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... Imagine for a moment that even an earthworm may possess a love of self and a love of others. #3 2012-12-07 17:29:47
Re: Distance to the wall of the boxmax value of a and b = (a + b + |a - b|) / 2 Imagine for a moment that even an earthworm may possess a love of self and a love of others. #4 2012-12-07 18:11:58
Re: Distance to the wall of the boxHere's an awkward way to avoid absolute value signs: Imagine for a moment that even an earthworm may possess a love of self and a love of others. #5 2012-12-08 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. |