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