Sunday 24 November 2013

Solution of Linear Eqns in three dimensions

The solution of the following set of equations has been well studied.

$$a_1x+a_2y+a_3z=d_1\\ b_1x+b_2y+b_3z=d_2\\ c_1x+c_2y+c_3z=d_3\\ $$
The most popular method of solving this is through determinants.

In todays article I am putting a different form and solution. for the above equations.
Changing the form of these equations to Vectors

We get
$$\overrightarrow{A}.\overrightarrow{r} = d_1\\ \overrightarrow{B}.\overrightarrow{r} = d_2\\ \overrightarrow{C}.\overrightarrow{r} = d_3\\ $$
Where
$$ \overrightarrow{A} = a_1\mathbf{i}+a_2\mathbf{j}+a_3\mathbf{k}\\ \overrightarrow{B} = b_1\mathbf{i}+b_2\mathbf{j}+b_3\mathbf{k}\\ \overrightarrow{C} = c_1\mathbf{i}+c_2\mathbf{j}+c_3\mathbf{k}\\ \overrightarrow{r} = x\mathbf{i}+y\mathbf{j}+z\mathbf{k}\\ $$
$.$ is the usual dot product in vectors
$\mathbf{i},\mathbf{j},\mathbf{k}$ are unit vectors
It occurs to me that the solution for the above could be
$$ \overrightarrow{r} = \frac{(\overrightarrow{B}\times\overrightarrow{C}d_1+\overrightarrow{C}\times\overrightarrow{A}d_2+\overrightarrow{A}\times\overrightarrow{B}d_3)}{\overrightarrow{A}\times\overrightarrow{B}.\overrightarrow{C}} $$
I have coarsely checked this for correctness by solving using determinants and have found
similar result.

The method of coming to the above solution is as below

$$ \overrightarrow{C}\times\overrightarrow{B}.\overrightarrow{A}.r = \overrightarrow{C}\times\overrightarrow{B}d_1\\ \overrightarrow{C}\times\overrightarrow{A}.\overrightarrow{B}.r = \overrightarrow{C}\times\overrightarrow{A}d_2\\ \overrightarrow{A}\times\overrightarrow{B}.\overrightarrow{C}.r = \overrightarrow{A}\times\overrightarrow{B}d_3\\ $$
An implicit associativity is assumed above which is not correct. The above three equations are added and we get

$$ [\overrightarrow{C}\times\overrightarrow{B}.\overrightarrow{A} + \overrightarrow{C}\times\overrightarrow{A}.\overrightarrow{B} + \overrightarrow{A}\times\overrightarrow{B}.\overrightarrow{C}].\overrightarrow{r} = \overrightarrow{C}\times\overrightarrow{B}d_1+\overrightarrow{C}\times\overrightarrow{A}d_2+\overrightarrow{A}\times\overrightarrow{B}d_3\\ $$
Hence from the above after rearranging we get $$ \overrightarrow{r} = \frac{\overrightarrow{C}\times\overrightarrow{B}d_1+\overrightarrow{C}\times\overrightarrow{A}d_2+\overrightarrow{A}\times\overrightarrow{B}d_3}{\overrightarrow{A}\times\overrightarrow{B}.\overrightarrow{C}+\overrightarrow{C}\times\overrightarrow{B}.\overrightarrow{A}+\overrightarrow{C}\times\overrightarrow{A}.\overrightarrow{B}}\\ \\ reduces \space to\\ \overrightarrow{r} = \frac{(\overrightarrow{B}\times\overrightarrow{C}d_1+\overrightarrow{C}\times\overrightarrow{A}d_2+\overrightarrow{A}\times\overrightarrow{B}d_3)}{\overrightarrow{A}\times\overrightarrow{B}.\overrightarrow{C}} $$ as the other two components are of opposite sign and cancle each other
The below is true since they represent the volume of the parallelopiped formed by vectors $\overrightarrow{A}, \overrightarrow{B}, \overrightarrow{C}$. Assuming the vectors are cyclic in order in 3D space. Then $$ \overrightarrow{A}\times\overrightarrow{B}.\overrightarrow{C} = \overrightarrow{B}\times\overrightarrow{C}.\overrightarrow{A} = \overrightarrow{C}\times\overrightarrow{A}.\overrightarrow{B}\\ \overrightarrow{A}\times\overrightarrow{B}.\overrightarrow{C} = -\overrightarrow{B}\times\overrightarrow{A}.\overrightarrow{C}\\ \overrightarrow{B}\times\overrightarrow{C}.\overrightarrow{A} = -\overrightarrow{C}\times\overrightarrow{B}.\overrightarrow{A}\\ \overrightarrow{C}\times\overrightarrow{A}.\overrightarrow{B} = -\overrightarrow{A}\times\overrightarrow{C}.\overrightarrow{B}\\ $$

The above solution could be extended for dimensions higher than three. In this I am not covering the same.

Alternate solution to arriving at the aboev formula

Assuming that the solution to the above equation is of the form without any loss of generality
$$ \overrightarrow{r} = t\overrightarrow{A}\times\overrightarrow{B}+u\overrightarrow{B}\times\overrightarrow{C}+v\overrightarrow{C}\times\overrightarrow{A}\\ $$ where $t,u,v$ are scalars coefficients.
$t,u,v$ can be solved as below

Substitute $\overrightarrow{r}$ into the original equations
  $$ \overrightarrow{A}(t\overrightarrow{A}\times\overrightarrow{B}+u\overrightarrow{B}\times\overrightarrow{C}+v\overrightarrow{C}\times\overrightarrow{A}) = d_1\\ \overrightarrow{A}.\overrightarrow{A}\times\overrightarrow{B}=0\\ \overrightarrow{A}.\overrightarrow{B}\times\overrightarrow{C} \space has \space some \space value\\ \overrightarrow{A}.\overrightarrow{C}\times\overrightarrow{A}=0\\ $$ Therefore we get $$ u = \frac{d_1}{\overrightarrow{A}.\overrightarrow{B}\times\overrightarrow{C}}\\ Similarly \space for \space t,v \space we \space get \space t = \frac{d_2}{\overrightarrow{C}.\overrightarrow{A}\times\overrightarrow{B}}\\ v = \frac{d_3}{\overrightarrow{B}.\overrightarrow{C}\times\overrightarrow{A}}\\ $$
Since the $\overrightarrow{A}.\overrightarrow{B}\times\overrightarrow{C} = \overrightarrow{C}.\overrightarrow{A}\times\overrightarrow{B} = \overrightarrow{B}.\overrightarrow{C}\times\overrightarrow{A} =$ volume of parallelopipe

Therefore the solution to the linear equation is
Substituting $u,t,v$ in the initial equation we get the following
$$ \overrightarrow{r} = \frac{\overrightarrow{B}\times\overrightarrow{C}d_1+\overrightarrow{C}\times\overrightarrow{A}d_2+\overrightarrow{A}\times\overrightarrow{B}d_3}{\overrightarrow{A}\times\overrightarrow{B}.\overrightarrow{C}}\\ $$ RP
info@softanalytics.net



Friday 6 September 2013

Area of triangle in 3D space

Once it occurred to me if there was a very quick way (split seconds) of computing the area of the triangle formed by the points of axis intercepts of the plane
$\frac{x}{a}+\frac{y}{b}+\frac{z}{c}=1$ Solution:
A half tetrahedron is formed by the planes $xy, yz, xz$ and $\frac{x}{a}+\frac{y}{b}+\frac{z}{c}=1$
Three of the sides of the tetrahedron have area $ab/2, bc/2, ac/2$. These sides are orthogonal
Hence the vector equivalent of the resultant is
$\frac{abi}{2} + \frac{bcj}{2} + \frac{ack}{2}$  (where $i,j,k$ are unit vectors)
Modulus of the resultant is (   $\sqrt{a^2b^2/4 + b^2c^2/4 + a^2c^2/4}$   )

Area of interest is

$$ \sqrt { a^2b^2/4 + b^2c^2/4 + a^2c^2/4 }
$$
This method could be applied to the generic case where we need to find the area of the
triangle formed by ($x1,y1,z1) (x2,y2,z2) (x3,y3,z3)$
Steps would be as below

Transform the coordinates in such a manner that the coordinates above turn into axes intercepts
$(0,0,a) (0,b,0) (c,0,0)$

Then apply the formula above

RP
info@softanalytics.net



Thursday 5 September 2013

Analyzing the differentiability of $\sqrt{x^2}$

Analyzing differentiability of $\sqrt{x^2}$

As we see a quick simplification of $\sqrt{x^2}$ yields $x$ which is a straight line.
Another simplification yields $|x|$

Clearly $|x|$ is not differentiable whereas $x$ is differentiable.

Some people might contest the $|x|$ simplification saying that is not true. I think both simplifications are correct and hence depending upon the simplification this may or may not be differentiable.

RP
info@softanalytics.net