matlab code for having a ball move around in 2D and 3D space using Euler Method