Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
So imagine we express each basis quantity as a column vector with entries {Length, Time, Mass, Temperature, etc.}, (e.g. c is {1,-1,0,..}) and construct a matrix with each basis quantity as a column vector. Then multiply that matrix by the column vector {?,?,?,...}, and set it equal to the user's input quantity (e.g. distance {1,0,...}), then solve for the {?,?,?,..}. This will return the user's quantity in terms of ANY quantity they choose (given they provide a linearly independent basis).
Well, I know of maybe not the most elegant solution. But what we're trying to do is express one quantity as a linear combination of other quantities. Which means we WILL have a unique solution when the basis we choose is linearly independent.
Your answer has inspired me to pursue a generalization of this. Instead of only going between systems with 1→1 equivalences, what about a more general system of any quantity? For example, expressing energy in h/s, or lengths in c*t. In a theoretical application, the ability to use your unitConvert with unitConvert[q, {c,G,h, Kb, etc.}] Thanks again for your excellent response!