Photovoltaic energy has experienced tremendous growth in terms of implementation at facilities for power supply in rural areas and for energy dispatch to grid. The relative position of the fixed panels can present the problem of varying amounts of shadowing among them, which can reduce the overall energy produced from the array of photovoltaic panels on specific dates and times, in addition to the problems in each of the panels themselves. The existing methods calculate the distances between the rows of PV panels using a fixed height of the sun, such that the rays always strike perpendicular to the panels, thereby limiting the duration of solar gain to 4h. This paper proposes a method that optimises the minimisation of the distance between the rows of fixed photovoltaic panels. The proposed method is based on the exact calculation of the shadows of the panels for the different positions of the sun, which depends on the latitude of the facility, throughout the course of the day and for all of the planned hours of solar gain. To illustrate the proposed method, it has been applied to a case study for which the solutions obtained using the traditional methods are compared, indicating that the distance can be reduced by up to 40% when the tilt angle of the panel is 60°. In conclusion, the proposed general method for optimally minimising the distance between the PV panels in solar arrays, which is of particular interest for standalone photovoltaic (PV) systems in remote areas that act as isolated small power producing units for the supply of electricity.