#### sCTF.io 2016 Q1 // Tracking (85 points)

Capture the Flag, sCTF.io April 16, 2016, 0 Comment 351This challenge required a program that would take analyze all of the values, and some math to manipulate the given equations.

First off, we are given the location of all 4 satellites. They are;

*A: (0, 0, 0)*

* B: (2000, 0, 0)*

* C: (2000, 2000, 0)*

* D: (3000, 1500, 1700)*

We are also given equations to find the locations of the input points. These equations are;

Finally, we have the input. There are multiple lines, but each one gives distances from all 4 satellites. Here is a sample input line;

*1247.9110545227172 1556.0469144598437 1620.2721993541702 2729.337282198739*

As we can see, there are spaces between the lines, and therefore it can be read with a Java scanner’s nextDouble().

First off, we needed to understand the equations. We can see that there are common variables, x, y and z through all them. We want to solve for these. Next, there are some other variables, p, q, r, s, t and u. These are variables that represent the coordinates of their respective satellites, and variables that are given to us.

We want to solve for one of the coordinates. Our strategy was to solve for x first, as we could easily eliminate y and z using the first 2 equations.

Now we can set these two equations equal to each other, then solve for x.

Now we have an equation for the x variable. Let’s find one for y. We can do this by using the first and third equations.

And set them equal.

Even though there are 2 unknowns, x and y, we can use the value we had just found for x. Now let’s solve for y.

And now we just need to solve for z. Since we know x and y, we can just use the first equation.

Now that we have all of the equations, we just need to plug them into our program. After finding each coordinate, we need to keep track of the answer so we can find the average of all of the coordinates. When we put all of this together, we got these results;

*536.3778, 515.75555, 486.93332*

The flag is the rounded up value of each coordinate, so we submitted this flag;

*sctf{537, 516, 487}*

And got 85 points.

**Links**

## Leave a Reply