factor/library/math/more-matrices.factor

11 lines
216 B
Factor
Raw Normal View History

2005-05-21 02:28:23 -04:00
! Copyright (C) 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
IN: matrices
USING: kernel math ;
: norm ( v -- a )
dup v. sqrt ;
: normalize ( v -- v )
[ norm recip ] keep n*v ;