# How to understand the equation for a hyperplane?

I'm currently studying convex optimization using the Boyd's Convex Optimization. I'm studying about hyperplanes and their equations and had trouble understanding how exactly the hyperplane equation is to be interpreted. I read this answer and this answer and they are great answers no doubt, but I am still having trouble understanding the equation.

The definition of a hyperplane given by Boyd is the set

$$\{x\ |\ a^Tx = b\}\ (a \in \Bbb{R}^n,\ b \in \Bbb{R})$$

The explanation given is that this equation is "the set of points with a constant inner product to a given vector $$a$$ and the constant $$b \in \Bbb{R}$$ determines the offset of the hyerplane from the origin."

I am trying to understand the equation by using real values and visualizing it but am having trouble doing so. I'm not even sure if this is mathematically acceptable. For example, let's say that:

$$a = \begin{bmatrix}2\\2\end{bmatrix},\ x = \begin{bmatrix}x_1\\x_2\end{bmatrix} \in \Bbb{R}^2$$ and

$$b = 3$$

then $$2x_1 + 2x_2 = 3$$ draws a line which I assumed is a hyperplane.

Is this interpretation correct? If it is, this doesn't make sense because the "offset from the origin" in this case is clearly not $$3$$, yet $$b = 3$$.

• Boyd doesn’t write that $b$ is the offset from the origin, only that it determines that offset.
– amd
Apr 1 '19 at 19:15

Your interpretation is correct. The actual distance to the origin will be given by $$\frac{|b|}{||a||},$$ so in your example the distance to the origin is $$\frac{3}{2\sqrt{2}}$$.

When $$b$$ is positive the offset is in the direction of $$a$$, and when $$b$$ is negative the offset is in the direction of $$-a$$.

• Hi, thanks for the answer! I have a question regarding your answer though: Why is the actual distance from the origin $|b| / \Vert a \Vert$? Perhaps I don't fully understand what $b$ and $a$ actually represent or I'm misunderstanding what "offset from the origin" means...
– Sean
Apr 1 '19 at 11:00
• @Seankala Study the diagram in mvw’s answer to math.stackexchange.com/questions/2175925/… closely.
– amd
Apr 1 '19 at 19:14
• @Seankala You're welcome! The following answer should also help math.stackexchange.com/questions/2678406/…. Note that if you scale the equation by any value, it will describe the same plane, but have a different $b$ value. $b$ gives the distance to the origin when $a$ is a unit vector. Because the dot product is the cosine of the angle between $a$ and $x$, $b$ is positive when the angle is acute, negative when obtuse, which explains the direction of the offset. Apr 1 '19 at 23:12
• Thank you for the clarification everyone! I'll take a closer look at the answers.
– Sean
Apr 2 '19 at 0:21
• That should say "scale the equation by any non-zero value". Apr 2 '19 at 0:23

This figure has given in Stephen Boyd

enter image description here

As per the given link(Hyperplane equation intuition / geometric interpretation) the geometric appreciation for this n-dimensional hyperplane equation is

$$\frac{1}{\left\lVert \hat a \right\rVert} \times\ (\hat a \dot\ \hat x) = d$$ Which we can write as

$$\frac{(\hat a \dot\ \hat x) }{\left\lVert \hat a \right\rVert} = d$$

$$\frac{(a^T x) }{\left\lVert \hat a \right\rVert} = d$$

since $$(a^T x)=b$$

we can say that $$\frac{b}{\left\lVert \hat a \right\rVert} = d$$

That is the $$b \in \mathbf R$$ determines the offset of the hyperplane from the origin.