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]]
#> [1] 0.99874607 0.00000000 0.05006278
#> 
#> [[2]]
#> [1]  0.099874607  1.000000000 -0.005006278
#>