The rectus femoris muscle has two functions. The first main function of this muscle is extending the leg at the knee, such that it straightens the leg below the knee. During this action, when the leg is extending the rectus femoris muscle contracts allowing the leg to move. Without this muscle walking, running and other similar actions would not be possible. Another function of this muscle is hip flexion. The rectus femoris aids in flexing the thigh at the hip. This allows the thigh to move away from the hip. The rectus femoris is the only quadricep muscle that crosses the hip joint and attaches to the AIIS. This is why the second function of the rectus femoris is hip flexion.