He studied Mathematics at Glasgow University under Robert Simson. His theological training is unclear but he was licensed to preach by the Church of Scotland in 1752. He was ordained at Wamphray church in 1755 and translated to Closeburn in 1757. In 1761 he was appointed Professor of Mathematics at Glasgow University in succession to his mentor Prof Simson.[1][2]