factor/library/math/more-matrices.factor

8 lines
213 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 ;
2005-05-22 22:08:46 -04:00
: norm ( vec -- n ) dup v. sqrt ;
: normalize ( vec -- vec ) [ norm recip ] keep n*v ;