0
$\begingroup$

Let the hyperplane equation be $\theta^Tx + \theta_0 = 0.$ Let p be any point. Find the signed perpendicular distance between the point and the hyperplane. (Answer in terms of $\theta^Tx$, $\theta_0$, and $p$; you may not answer using $x$)

My attempt: $$(p-x)*\theta^T*(\frac1{len\theta^T})$$ Then I distribute the $\theta^T$: $$ p*\theta^T - x*\theta^T*(\frac1{len\theta^T})$$ The middle term can be re-written as $\theta_0$ from the equation we of the hyperplane.

We'll end up with $$ p*\theta^T + \theta_0*(\frac1{len\theta^T})$$

(Btw, $len\theta^T$ is the lengths of $\theta^T$)

$\endgroup$
  • 1
    $\begingroup$ Be very careful about the order of multiplicands. Given the original equation, $(p-x)\theta^T$ produces a matrix, not a scalar as you intend. $\endgroup$ – amd Feb 9 '19 at 1:29
  • $\begingroup$ But (p - x) produces a vector and $\theta^T$ is also a vector, so the dot product of two vectors must also be a vector? Right? $\endgroup$ – BigBear Feb 9 '19 at 2:01
  • 1
    $\begingroup$ The dot product of two vectors is a scalar $\endgroup$ – David M. Feb 9 '19 at 3:19
  • 1
    $\begingroup$ Matrix multiplication, and this includes vectors, is not commutative. $p-x$ is an $n\times 1$ vector; $\theta^T$ is a $1\times n$ vector. $(p-x)\theta^T$ is therefore an $n\times n$ matrix. $\theta^T(p-x)$, on the other hand, is a $1\times1$ matrix—a scalar. Both appear in a standard formula for orthogonal projection, so you’d be well advised to learn the difference. $\endgroup$ – amd Feb 9 '19 at 3:46
0
$\begingroup$

Geometrically $\theta$ is a normal vector to the hyperplane $H$. Then we must draw a line $l$ from $p$ in the direction of $\theta$ and compute the distance between $p$ and $q \in l\cap H$.

Every point in $l$ is written as $p+ t\theta$ for some $t\in \mathbb{R}$. To find the point of intersection with $H$ we just set the equation $$ 0 = \theta^T( p + t\theta) + \theta_0 = \theta^T\cdot p + t\theta^T\cdot \theta + \theta_0 $$ Solving for $t$ we get $t = \frac{-\theta_0 - \theta^T\cdot p}{\|\theta\|^2}$. Hence $$ q = p + \frac{-\theta_0 - \theta^T\cdot p}{\|\theta\|^2}\theta $$ Now we head to the signed distance. We have that $$(p-q)^T\cdot \frac{\theta}{\|\theta\|} = \frac{\theta_0 + \theta^T\cdot p}{\|\theta\|}$$ Note that $$ \|q-p\| = \left\| \frac{-\theta_0 - \theta^T\cdot p}{\|\theta\|^2}\theta \right\| = \frac{|\theta_0 + \theta^T\cdot p|}{\|\theta\|} $$ which is the absolute value of the signed distance.

$\endgroup$
-1
$\begingroup$

Hi I am showing with one example. For finding the distance between Plane($\theta$ and $\theta_0$) and point $x$. $D=\dfrac{||\theta x+\theta_0||}{||\theta||}$

Signed distance=$\dfrac{(\theta x+\theta_0)}{||\theta||}$ Reference: http://mathworld.wolfram.com/Point-PlaneDistance.html

$\endgroup$
  • $\begingroup$ Welcome to MSE. Please edit and use MathJax to properly format math expressions. $\endgroup$ – Lee David Chung Lin Feb 11 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.