I'm about to start some numerical analysis work in C#, and was considering using operator overloading and classes such as Distance
, Speed
, Acceleration
, and so forth, together with suitably-defined operator overloads, to make sure all natural operations would be permitted and all mistaken ones forbidden, so that
speed = distance / time
would behave as one would expect but
acceleration = distance / time
would not compile (or at least throw an exception).
I can't be the first person to want this so I was wondering if anyone knew of a suitable library available for use?