Reputation: 11
For a past week I been trying to construct specific functions that would satisfy some the requirements, sadly it was not successful. I decided to give a shot in stack overflow.
I have three shapes in 2D world as shown in the image. Shape A with center a
, Shape B with center b
and shape C with center c
. For this problem shape form does not matter so I will not expand on that. Other important variables are d_ab
with represents minimum distance between shape A and B, d_bc
- distance between B and C, d_ac
- distance between A and C. Also d_ab
, d_bc
, d_ac
ranges from 0 to 1, where 1 represents shapes are touching and 0 their too far from specific threshold.
I am trying to find three new functions:
f_a(d_ab, d_bc, d_ac) = x
f_b(d_ab, d_bc, d_ac) = y
f_c(d_ab, d_bc, d_ac) = z
Firstly, these functions with inputs d_ab
, d_bc
, d_ac
in the left side table should result to values x
, y
, z
right side table:
d_ab | d_bc | d_ac | x | y | z |
---|---|---|---|---|---|
1 |
0 |
0 |
(a+b)/2 |
(a+b)/2 |
c |
0 |
1 |
0 |
a |
(b+c)/2 |
(b+c)/2 |
0 |
0 |
1 |
(a+c)/2 |
b |
(a+c)/2 |
1 |
1 |
1 |
(a+b+c)/3 |
(a+b+c)/3 |
(a+b+c)/3 |
0 |
0 |
0 |
a |
b |
c |
Secondly, all other inputs d_ab
, d_bc
, d_ac
that are not described in table (From 0 to 1) should result in interpolated values between closest ensuring continuity (Continuity I am referring there is that small change in input should not produce big difference in output, there is probably better way to describe this mathematically).
For example:
f_a(0.3, 0, 0) = x
Most likely will combine equitation's from table:
f_a(0, 0, 0) = a
f_a(1, 0, 0) = (a+b)/2
Resulting into:
f_a(0.3, 0, 0) = 0.7 * a + 0.3 * (a+b)/2
I am curious is there a method to find these kind of functions, I assume there could be more than one that satisfies this requirement. But I am fine with any of it as long it has that continuity that I referred above.
I almost sure there is better way to represent this problem mathematically, but I am not that great with it.
Upvotes: 1
Views: 42