Skip to contents

Make two vectors orthogonal by moving them in opposite directions in the plane they span. vdot(x,y) < 1.0e-4 are considered orthogonal.

Usage

v_orthogonalize(x, y)

Source

https://www.snsn.se/SH/SHcode/Python/BL.py

Arguments

x, y

Coordinates of the two vectors. Any coordinates system

Value

Orthogonalized vectors. In the same coordinate system

Examples

v_orthogonalize(c(1, 0, 0), c(.1, 1, 0))
#> [[1]]
#>              x y          z
#> [1,] 0.9987461 0 0.05006278
#> 
#> [[2]]
#>               x y            z
#> [1,] 0.09987461 1 -0.005006278
#>