Method: Stick::Vector#proj
- Defined in:
- lib/stick/matrix.rb
#proj(v) ⇒ Object
Projection operator (en.wikipedia.org/wiki/Gram-Schmidt_process#The_Gram.E2.80.93Schmidt_process)
184 185 186 187 188 |
# File 'lib/stick/matrix.rb', line 184 def proj(v) vp = v.inner_product(self) vp = Float vp if vp.is_a?(Integer) self * (vp / inner_product(self)) end |