Improvements to photometry. Part 1: Better estimation of derivatives in extinction and transformation equations