\textit{ Formation control is a research topic of multi-robot control, where a group of robots can reach a certain formation and defend it when moving in the desired direction. One of the developments is distance-based where formation goals achieved using the distance between each other only. Many developments are using a simple model and need further development into a realistic model. When applying distance-based, there is a problem in the initial condition, namely that the robot cannot find the coordinates of its neighbors when using only distance. In this work, the cosine algorithm was developed as a solution to the initial conditions which are inspired by a simple triangle formula and need only two steps to find the coordinates. From simulation experiment results, distance-based formation control using three holonomic robot models and the application of the cosine algorithm takes an average of 6.5 seconds to find the coordinates of its neighbors.}