A powered transfemoral prosthesis is an assistive device for patients with above knee amputation. For these patients, walking on various sloped surfaces is one of the most challenging tasks in their daily lives. Designing prostheses that can effectively adapt to varying terrain remains an ordeal to this date. In this thesis, we focused on generating the desired trajectories for various inclined surfaces without prior knowledge of slopes using human impedance and cubic-Bezier-polynomials-based optimization. Trajectory generation for the powered prosthesis is an important procedure to design an appropriate controller that mimics human locomotion; the trajectory has to be generated for each gait cycle in realtime to produce a stable, robust, and human-like walking. The proposed method is rooted in analyzing the human data from the motion capture system, to gain an understanding of how human walks differently according to the slopes. Impedance control using human parameters allows the prosthesis adapt to these different slopes during the stance phase. Since impedance control is used only during the stance phase, we were prompted to consider a different control strategy for the swing phase. These trajectories are tracked using PD control. Thus, we proposed the cubic-Bezier-curve-based optimization to generate appropriate trajectories for the given slopes during the swing phase, without any information regarding the slopes. Before the heel contact occurs (terminal swing phase), low gain PD control is used to adapt to the unexpected slopes and smoothly track the generated trajectories. To validate the proposed framework, the concept was implemented on a transfemoral prosthesis, AMPRO II, on various slopes. The main objective of the thesis is to propose and verify a unified framework that enables the transfemoral prosthesis to perform real-time inclined walking without a priori information regarding the terrain.