Function Repository Resource:

# BasisFromVector

Generate an orthonormal basis from a given 3D vector

Contributed by: Jan Mangaldan
 ResourceFunction["BasisFromVector"][v] generates an orthonormal basis from the numerical three-dimensional vector v.

## Details

The input vector is normalized and given as the first element of the resulting basis.

## Examples

### Basic Examples (2)

Generate an orthonormal basis from a real vector:

 In[1]:=
 Out[1]=

Verify orthonormality:

 In[2]:=
 Out[2]=

Generate an orthonormal basis from a complex vector:

 In[3]:=
 Out[3]=

Verify orthonormality:

 In[4]:=
 Out[4]=

### Scope (6)

A rational-valued vector:

 In[5]:=
 Out[5]=

An exact complex vector:

 In[6]:=
 Out[6]=

An approximate MachinePrecision real vector:

 In[7]:=
 Out[7]=

An approximate MachinePrecision complex vector:

 In[8]:=
 Out[8]=

An approximate arbitrary-precision real vector:

 In[9]:=
 Out[9]=

An approximate arbitrary-precision complex vector:

 In[10]:=
 Out[10]=

### Applications (3)

Generate a random point on the sphere:

 In[11]:=
 Out[11]=

Construct the orthonormal basis:

 In[12]:=
 Out[12]=

Visualize the basis vectors:

 In[13]:=
 Out[13]=

### Possible Issues (2)

BasisFromVector only generates one out of many possible orthonormal bases:

 In[14]:=
 Out[14]=

BasisFromVector always generates a right-handed basis:

 In[15]:=
 Out[15]=
 In[16]:=
 Out[16]=

### Neat Examples (1)

Generate a set of orthonormal frames along a curve:

 In[17]:=
 Out[17]=

## Version History

• 1.1.0 – 09 February 2021
• 1.0.0 – 21 October 2019