A sensor-based navigation algorithm for mobile robot such as Tangent Bug algorithm works only for stationary obstacles. In this paper we proposed the navigation algorithm which works for moving obstacles and stationary ones with unknown environment, using a new idea that distinguishes moving obstacles from stationary ones with a distance information of the sensor of mobile robot, while moving along the boundary of the obstacles. The idea is based on the definition of an angle toward the wall surface that is called the direction vector toward the wall surface. The angle of the direction vector of each step is accumulated while following the boundary. When the total accumulated angle is over 2π radian, the following obstacle is recognized a moving obstacle. In this paper the effectiveness of this algorithm for moving obstacles is shown by some simulations.