Expanding $\big( (D_x + u E_x) - C_x \big)^2 + \big( (D_y + u E_y) - C_y \big)^2 + \big( (D_z + u E_z) - C_z \big)^2 = R^2$

21 Views Asked by At

In this explanation of ray-sphere intersections the author indicates that when expanding:

$$\big( (D_x + u E_x) - C_x \big)^2 + \big( (D_y + u E_y) - C_y \big)^2 + \big( (D_z + u E_z) - C_z \big)^2 = R^2$$

The result is :

$$\begin{align*} & E_x^2 u^2 + 2 E_x(D_x - C_x)u + (D_x - C_x)^2 + \\ & E_y^2 u^2 + 2 E_y(D_y - C_y)u + (D_y - C_y)^2 + \\ & E_z^2 u^2 + 2 E_z(D_z - C_z)u + (D_z - C_z)^2 = R^2 \end{align*}$$

The square of the sum of three or more terms can be determined by the following general formula:

$$(a + b - c)^2 = a^2 + b^2 + c^2 + 2ab – 2bc - 2ca$$

The result would be obviously different, so

Question: How did the author obtain his result?

1

There are 1 best solutions below

0
On BEST ANSWER

We have with your formula

\begin{align*}\big((D_x + u E_x) - C_x \big)^2 &= D_x ^2 + u^2 E_x^2 + C_x^2 + 2uD_xE_x - 2uC_xE_x - 2C_xD_x \\ &= E_x^2 u^2 + (2uD_xE_x - 2uC_xE_x) +(D_x ^2 - 2C_xD_x + C_x^2) \\ &= E_x^2u^2 + 2E_x(D_x - C_x)u + (D_x - C_x)^2. \end{align*} Analogous you get the other expressions and summing it up gives you \begin{align*} & E_x^2 u^2 + 2 E_x(D_x - C_x)u + (D_x - C_x)^2 + \\ & E_y^2 u^2 + 2 E_y(D_y - C_y)u + (D_y - C_y)^2 + \\ & E_z^2 u^2 + 2 E_z(D_z - C_z)u + (D_z - C_z)^2 = R^2 \end{align*}

So the only thing the author does is simplifying each term by using the binomial formula. Hope you can understand it now :)