A system for parking a vehicle, comprising: a memory to store a set of analytical functions corresponding to a set of patterns of elementary paths, and to store a set of cost functions corresponding to the set of patterns and the set of analytical functions, each pattern represents a continuous path and each analytical function is determined for a corresponding pattern to provide an analytical solution for input states of the vehicle defining a continuous path connecting the input states by a sequential composition of the elementary paths following the corresponding pattern; a path planner to select from the memory, in response to receiving an initial state and a target state of the vehicle, wherein the target state is a final state for a parking spot to park the vehicle, an analytical function corresponding to a minimum cost of the continuous curvature path connecting the initial state with the target state and to analytically determine parameters of the continuous curvature path using the selected analytical function, wherein the path planner determines the cost of each pattern using the corresponding cost function and selects the analytical function corresponding to the pattern having the minimal cost, wherein the cost of each pattern is indicative of length of the continuous path represented by the pattern, the path planner being further configured for selecting another target state if a path according to the initial and target states could not be determined; and a controller to control the motion of the vehicle according to the parameters of the continuous curvature path if a path according to the initial and target states could be determined, and wherein the set of patterns is an exhaustive set that guaranties that for any values of the input states, there is at least one pattern that represents a feasible continuous curvature path connecting the input states without consideration of obstacles, and the set of patterns consists of 48 different patterns representing transformed Reeds-Shepp paths, wherein each pattern in the set is formed by replacing all circular arcs in a corresponding pattern representing an RS path with clothoid turns; wherein the parameters of the continuous curvature path includes a sequence of coordinates and orientation angles of points on a plane of the motion of the vehicle forming the continuous curvature path. a memory to store a set of analytical functions corresponding to a set of patterns of elementary paths, and to store a set of cost functions corresponding to the set of patterns and the set of analytical functions, each pattern represents a continuous path and each analytical function is determined for a corresponding pattern to provide an analytical solution for input states of the vehicle defining a continuous path connecting the input states by a sequential composition of the elementary paths following the corresponding pattern; a path planner to select from the memory, in response to receiving an initial state and a target state of the vehicle, wherein the target state is a final state for a parking spot to park the vehicle, an analytical function corresponding to a minimum cost of the continuous curvature path connecting the initial state with the target state and to analytically determine parameters of the continuous curvature path using the selected analytical function, wherein the path planner determines the cost of each pattern using the corresponding cost function and selects the analytical function corresponding to the pattern having the minimal cost, wherein the cost of each pattern is indicative of length of the continuous path represented by the pattern, the path planner being further configured for selecting another target state if a path according to the initial and target states could not be determined; and a controller to control the motion of the vehicle according to the parameters of the continuous curvature path if a path according to the initial and target states could be determined, and wherein the set of patterns is an exhaustive set that guaranties that for any values of the input states, there is at least one pattern that represents a feasible continuous curvature path connecting the input states without consideration of obstacles, and the set of patterns consists of 48 different patterns representing transformed Reeds-Shepp paths, wherein each pattern in the set is formed by replacing all circular arcs in a corresponding pattern representing an RS path with clothoid turns; wherein the parameters of the continuous curvature path includes a sequence of coordinates and orientation angles of points on a plane of the motion of the vehicle forming the continuous curvature path.