Sam's Brain is a code that takes two pairs of coordinates along with their horizontal angles, in Minecraft, and uses trigonometric equations to estimate the exact position of a stronghold. The following equations are used to track the estimated coordinates of x and z in the Overworld:
If you open F3, you will see on the left side of the screen is a set of coordiantes in (x, y, z) format. Three lines below are the angles, both horizontal and vertical respectively, in which the player is facing. Enter the coordinates in the program.
Throw an Eye of Ender and track the exact center in which the eye is only moving vertically. Write down the position of x and z and the horizontal angle. Enter the coordinates in the program.
Move to a spot either left or right of where your first threw an eye to where there is no interference. Throw another Eye of Ender.
Once the estimated coordinates are given, travel to those coordinates and throw another eye. If you are in creative mode, use the command /locate #minecraft:stronghold to see how close you are to the nearest stronghold.
The equations above were created by samkomododragon on Discord. I was given permission to code these equations in C++ and run them in a Linux terminal. Please remember that the coordinates calculated are not 100% exact, but majority of tests have shown the distance between the estimated position and the exact position of the stronghold is very low.
Q: What if I want to run just the binary file?
A: If you are going to run the binary executable, it is best to use a Ubuntu terminal. You can use either your virtual machine (VM) or use Ubuntu for Windows by downloading it in the Microsoft Store (it's free).
Q: Will this work in Visual Studio or any other application that uses a built-in debugger?
A: Yes. Originally, the M_PI macro was originally used to resemble pi. However, because Windows does not recognize this macro, the error checker marks M_PI as undefined. Now, pi is calculated using (2 * acos(0.0)), which still provides the correct calculations as before.