In this paper, we present a mathematical algorithm for the optimal orientation of solar panels multi-apartment buildings. Currently, photovoltaic power generation has increasingly become an effective method. It advantage not causing environmental pollution; however, it disadvantage relatively low efficiency. To increase efficiency panel, one can consider rotation. However, if there is limitatio...