Если даны градусы, тогда решается так.
22°39' = ( 22 + (39/60))*π/180 = (22 + (13/20) )*π/180 = (π/180)*(440+13)/20 =
= (π/180)*(453/20) = π*151/(20*60) = (151*π/1200).
237°27'20'' = (237 + (27/60) + (20/3600) )*π/180 = (237 + (9/20) + (1/180) )*π/180 =
= ( 237*180 + 9*9 + 1)*π/(180*180) = ( 42660 + 82)*π/(180*180) =
= 42742*π/(180*180) = 21371*π/(90*180) = 21371*π/16200