Spatial distribution of spin polarization in a channel on the surface of a topological insulator