Lateral view of a male legs with musculature highlighted. The focus of this image are the hamstring and gastrocnemius muscles. The hamstring muscles are any of three muscles at the back of the thigh that function to flex and rotate the leg and extend the thigh. The gastrocnemius muscle is the largest and most superficial muscle of the calf of the leg.