1. A legged robot that performs motion by changing a joint angle, comprising: a section of generating a center-of-gravity trajectory of the legged robot based on a trinomial equation obtained by discretizing a ZMP equation and a target ZMP; a section of calculating time-varying data of a target value of the joint angle based on the generated center-of-gravity trajectory; and a section of rotating a joint of the legged robot based on the calculated time-varying data of a target value of the joint angle, wherein the ZMP equation involves an angular momentum according to a center-of-gravity velocity of the legged robot.