2D geometric relation in a rectangle

57 Views Asked by At

I'm trying to implement the Sakoe & Chiba's global constraint for the Dynamic Time Warping algorithm but I'm stuck with a geometrical problem :

I'm trying to find the value of d given a, b and c.

relation between a, b, c and d

I think I have to use Pythagore but I miss a value to use it...

2

There are 2 best solutions below

2
On BEST ANSWER

For a start, notice that $$c = d\sin\arctan\left(\frac b a \right)$$ So $$d = c \sec\arctan\left(\frac b a \right) = c{\sqrt{1 + \left(\frac b a \right)^2}}$$


Alternatively, if you compare angles, you can see that two of the triangles are similar, so $$\dfrac{d}{c} = \frac{\sqrt{a^2 + b^2}}{a} $$

0
On

Purely by similar triangles, $\frac{c}{d} =\frac{a}{\sqrt{a^2+b^2}} $. No trig functions needed.