IntellaSys Blog

A Technical Post for the SEA of VentureForth Programmers
It is currently Sat May 25, 2013 2:45 pm

All times are UTC - 8 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Vector averaging
PostPosted: Wed Jan 09, 2008 12:39 pm 
Offline
Site Admin

Joined: Fri Jan 04, 2008 1:24 pm
Posts: 18

Vector averaging


C = (A + B) / 2, where A,B,C are vectors


2 base ! 011111011111011111 constant mask \ 6:6:6 mask,
\ use 011111110111101111 for 8:5:5, etc
hex

: average ( a b -- c )
over over and .
push xor 2/ mask
and pop + ; \ <6 ripple
\ Thanks John, for pointing to this source and fixing the bug in initial
\ implementation


Top
 Profile E-mail  
 
 Post subject: Vector averaging
PostPosted: Wed Jan 09, 2008 5:11 pm 
Offline
Site Admin

Joined: Mon Jan 07, 2008 10:37 am
Posts: 5
Vector averaging

C = (A + B) / 2, where A,B,C are vectors


Code:
2 base ! 011111011111011111 constant mask \ 6:6:6 mask,
                                          \ use 011111110111101111 for 8:5:5, etc
hex

: average ( a b -- c )
  over over and  .
  push xor  2/   mask #
  and  pop  . +    ;                        \ <6 ripple

Thanks John, for pointing to this source and fixing the bug in initial implementation. And thanks Charley to pointing at missing nop in front of +


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group