Code for calculating twisting motion in fish bodies and tails during swimming