45 lines
630 B
Markdown
45 lines
630 B
Markdown
# Create a orthogonal Vector
|
|
|
|
For this we can use the dotproduct.
|
|
|
|
Example:
|
|
|
|
```latex
|
|
V_1 = [1,6,2] \\
|
|
V_2 = ?
|
|
```
|
|
|
|
We know that the dot product of these two vectors must be zero, we can use that
|
|
|
|
```latex
|
|
V_1 \cdot V_2 = 0
|
|
```
|
|
|
|
Let's plug in our numbers
|
|
|
|
```latex
|
|
1 * V_2x + 6 * V_2y + 2 *V_2z = 0
|
|
```
|
|
|
|
Lets choose arbitrary numbers for $V_2x$ and $V_2y$, for now $1$ because that makes the calculation a bit easier
|
|
|
|
```latex
|
|
1*1+6*1+2*V_2z = 0
|
|
```
|
|
```latex
|
|
7+2V_2z = 0
|
|
|
|
V_2z = -3.5
|
|
```
|
|
|
|
```ts
|
|
// Note the the resulting vector can be very large
|
|
function findOrthogonalVector([x,y,z]:number[]){
|
|
return [1,1,-((x+y)/z)]
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|