Thanks for reply but i solved the division. Author mismatch the division between fireworks explodation
The code should be like this
PHP Code:
length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityvec[1]+velocityvec[2]*velocityvec[2])
velocityvec[0]=velocityvec[1]*1000/length
velocityvec[1]=velocityvec[2]*1000/length
velocityvec[2]=velocityvec[0]*1000/length