Utility functions
These are all lower level functions for performing calculations and unit/frame conversions