Distributed formation control of networked mechanical systems