Formulas for computing the line shape of a thin-walled hollow pier body based on structural characteristics and measured sunlight temperature difference are derived using an analytical algorithm. In a case study of the No. 5 pier of a newly constructed continuous beam bridge on a mountainous expressway of Guizhou Province in China, the pier top’s displacement calculated by the analytical algorithm, currently accepted code, and a FEM program were each compared to its measured values. Furthermore, the effects of sunlight temperature difference, pier height, and wall thickness on the line shape of the pier body were explored, and the results show that the calculation values from these formulas were closer to the measured values than the currently accepted code, with a maximum error of 0.507 mm, demonstrating that the formulas have a more dependable result, higher precision, and more specific applicability. Thus, the algorithm provides a better method for the line shape calculation and construction control of thin-walled hollow piers because it can accurately account for sunlight temperature differences and pier height.