Added transformations and utility functions for ideal line calculation