inst/snippet/vector-decomp2.R

v1 <- c(1,0,0)
v2 <- c(1,1,1)
x  <- c( 2,3,5)
vdecomp(x,v1,v2)
h <- x - vdecomp(x,v1,v2)$x.proj; 
round(h,8)
round(dot(h,v1),8)
round(dot(h,v2),8)

Try the fastR package in your browser

Any scripts or data that you put into this service are public.

fastR documentation built on May 1, 2019, 11:18 p.m.