Wikipedia:Reference desk/Archives/Mathematics/2016 September 2

= September 2 =

an oblique kind of distance formula
Given the angle between two lines, and the signed distance of a point (in the same plane) from each of those lines, what is the point's distance² from their intersection? I've derived this (with difficulty) twice and mislaid my answer; I think it's
 * $$u^2 + v^2 - \frac{uv}{\cos\alpha}$$

but have failed to confirm it, and can't recall how I derived it ... Maybe you know a straightforward derivation? —Tamfang (talk) 09:12, 2 September 2016 (UTC)
 * It's easy to see this formula is incorrect, it should reduce to $$u^2+v^2$$ for $$\alpha=\pi/2$$, infinity for $$\alpha=0, u\neq v$$ and indeterminate for $$\alpha=0, u=v$$.
 * Wlog assume that the intersection is at the origin and that the first line is horizontal. The normalized equation for the second line is $$-x\sin\alpha+y\cos\alpha=0$$. Then letting the point be at $$(x_0,y_0)$$, we have $$y_0=u$$ and $$-x_0\sin\alpha+y_0\cos\alpha=v$$, giving $$x_0=\frac{u\cos\alpha-v}{\sin\alpha}$$ so $$x_0^2+y_0^2 = \frac{u^2+v^2-2uv\cos\alpha}{\sin^2\alpha}$$. -- Meni Rosenfeld (talk) 10:34, 2 September 2016 (UTC)
 * I agree it's easy to see that I had it wrong; now that I'm awake I hoped to get here in time to remove it ;) Thanks! —Tamfang (talk) 17:03, 2 September 2016 (UTC)