The gastrocnemius, as the major muscle of the posterior shin, functions to extend the foot (plantar flexion). It ties in with the hamstrings at the knee joint where they are both involved in knee joint flexion. In addition, the insertion of the gastrocnemius on the femur helps to provide greater stability.
To be most effective the gastrocnemius must be taut in order to have a strong contraction at the knee joint. This means you must put the foot into flexion (dorsiflexion) to stretch the Achilles tendon and make the gastrocnemius muscle taut such that when it contracts, it will shorten the upper tendons at the knee immediately. In this case the muscle shortening will not result in taking up the slack of a relaxed Achilles tendon if the toes are pointed when the knee flexion takes place.
The practice of putting one end of a two jointed muscle on stretch in order to elicit a strong contraction at the other end is very important for increasing strength of two jointed muscles. This includes muscles such as the hamstrings, rectus femoris of the quadriceps group, biceps brachii, long head of the triceps brachii, and others.