The quadriceps femoris muscle mainly extends the leg at the knee joint, but the rectus femoris component also assists flexion of the thigh at the hip joint. Because the vastus muscles insert into the margins of the patella as well as into the quadriceps femoris tendon, they stabilize the position of the patella during knee joint movement.