R packages such as APE and Phangorn and so on allow you to compute evolutionary distance measures. Both packages and other related, phylogenetic based packages are written - at least in part - by the same author: Paradis.
The function dist.dna, for example, accepts as input an aligned set of DNA sequences, and has an optional parameter "model", which allows you to choose from many different evolutionary models, including all the ones you are looking to use here. http://www.inside-r.org/packages/cran/ape/docs/dist.dna. If you'd like to see how that function implements various models you could take a look at the code - although some of it is likely written in C as well as R.
If you read a book like the Phylogenetic Handbook here, where they discuss the mathematical derivations of distance measures - in fact there is a chapter dedicated to it - you will learn the classic models are in fact specific cases of the GTR model.