Let $A$ be a shape of dimension $N-1$ defined in an arbitrary number of dimensions $N$: $$c_0 + c_1n_1 + c_2n_2 + \cdots + c_{N-1}n_{N-1} = 0$$ where $n_1, n_2, n_3, \ldots , n_N$ are the axes.
Let $P$ be a point with coordinates $(p_1, p_2, p_3,\ldots,p_N)$.
Let $X$ be the point on shape $A$ that is closest to point $P$.
How would you find the coordinates of point $X$?
P.S. This is a step to find the reflection of point $P$ across shape $A$. Once the coordinates of $X$ are known, we can find the reflection of $P$: $$P' = (2x_1 - p_1, 2x_2 - p_2, 2x_3 - p_3, \ldots, 2x_N - p_N)$$
Based on @Jack's answer, here is the complete solution.
Let the hyperplane $A$ be described by normal vector $w$ and offset $b$.
Let $L$ be the line parameterized like this: $P + w \cdot t$.
Substituting $L$ into the equation for $A$ and solving for the value of $t$ that results in $L$ intersecting $A$, we get this: $$t_x = - \frac{b + \sum_{1}^{N} p_i w_i}{\sum_{1}^{N} w_i^2}$$
The intersection between $A$ and $L$, then, or the closest point on $A$ to $P$, can be found by plugging $t_x$ into the equation of the line: $$X = P + w \cdot t_x$$
The reflection of $P$ across $A$, then, can be found through the equation $P' = 2 X - P$. After plugging $X$ in, we get the answer: $$P' = P + 2 t_x w$$