1. ## intersecting circles (trilateration)

i was reading up on some info about GPS and how it works.. and i came across something called trilateration, from what i understand its when you are given 3 or more points and distances from each of those points, you construct the circles using the distances as radius' and they all intersect at 1 point..

anyway, i tried that out on paper but i couldnt figure out a way to 'prove' that the method works.. ie.. i know you can SEE the intersection but how can you prove its there? (using math).. so i made a little program that basically just let me define 3 points and the distances and it would draw the circles and they would all intersect at 1 point..

im trying to figure out how i can calculate the x,y position of the intersection given only the 3 x,y points and the 3 radius'... im pretty sure this must be easy but for some reason i cannot figure it out :\

i tried looking for function that check for intersecting circles but no luck so far.. i tried intersecting rectangles instead but that didnt work out..

anyone know a formula or a function or something i can use to calculate the position?

2. You need to find the points on the circles circumference (then find the one that appears in all three).

You know the radius and center so you can calculate a starting point (ie center_x + radius, center_y).
Increase the angle and use trig functions (sin, cos to get the new offset x,y from center) to calculate the next point on the circumfrence.

Watch for rounding errors.

I would search two circles. Find the two points they intersect and check the third for these points.

3. Originally Posted by X PaYnE X
so i made a little program that basically just let me define 3 points and the distances and it would draw the circles and they would all intersect at 1 point..
I don't really understand... When you take 3 random coords and 3 random radius' it would be pure luck if all three have one common point in their circumference right?

4. i thought the formula for a circle was

y^2 = r^2 - x^2

why would i need to use sin/cos/tan? anyway, i did what you said with the formula above but my circle is.. missing alot of points, anyway, what i did is, i gave each circle a color like.. red for 1.. green for the other.. etc.. and whenever they would overlap each other, the colors would mix, then when it was done intersecting.. there wud be 1 point that is white.. but when i compare that with the original value i get an error of 2 - 3 pixels..

anyway, anyone know a better method to use to draw a circle?

btw snip, the 3 circles all have 1 point on the circumference in common so it always intersects..