Help with v5 mecanum wheels Programming

http://www.robotc.net/blog/2011/11/22/vex-mecanum-drive-using-robotc/

see the code in the link. Although it is RobotC. Same algorithm should apply.