How to find a vector orthogonal to a side (given as another vector) of a triangle

1.1k Views Asked by At

My question was put a little bit odd but it's kind of hard to explain what I am trying to do. I have 3 points defined in 3D space. They form a triangle and I am trying to find how does moving the points relate to the surface area of the triangle or with other words I am searching the gradient of the triangle's surface area given these 3 points. So my idea is to calculate the gradient for each point individually.

My question is: If I have a point how to calculate the direction of the vector, that starts from the opposite side of the given point, which is also orthogonal to that side from which it starts . I tried to draw my idea so it can be a little bit more clear what I am trying to achieve. enter image description here

Thanks in advance !

2

There are 2 best solutions below

0
On

Given points $A$ (left red), $B$ (right red), $C$ (green) one can project vector $AC=C-A$ onto vector $AB=B-A$: $$ u_{AB} = (1/\lVert AB\rVert) \, AB \\ p = ( u_{AB} \cdot AC) \, u_{AB} $$ where $$ \lVert AB \rVert = \sqrt{(B-A)\cdot (B-A)} $$ is the length of $AB$, $\cdot$ is the standard scalar product, and then subtract $$ b = AC - p $$ to get the blue vector $b$.

4
On

I think there is a faster solution to your question based on your first paragraph, but feel free to disregard if it does not suit your purpose.

Let $p_1=(x_1,y_1,z_1),p_2=(x_2,y_2,z_2),p_3=(x_3,y_3,z_3) \in \mathbb{R}^3.$ Assuming they are not collinear, the area of the triangle that spans the three points is given by $$ \frac{1}{2} || (p_2-p_1) \times (p_3-p_1) ||$$ where the double bars mean magnitude

and $$(p_2-p_1) \times (p_3-p_1)=\begin{vmatrix} i && j && k \\ x_2-x_1 && y_2-y_1 && z_2-z_1 \\ x_3-x_1 && y_3-y_1 && z_3-z_1 \\ \end{vmatrix}.$$