intersecting circles (trilateration)

This is a discussion on intersecting circles (trilateration) within the Windows Programming forums, part of the Platform Specific Boards category; i was reading up on some info about GPS and how it works.. and i came across something called trilateration, ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    288

    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?

    thanks in advance

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    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.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    return 0;
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    89
    Quote 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. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    288
    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..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Circles and Computers
    By G4B3 in forum Tech Board
    Replies: 4
    Last Post: 11-29-2008, 08:23 AM
  2. Simple answer for intersecting lines?
    By LLINE in forum C++ Programming
    Replies: 6
    Last Post: 06-01-2008, 02:10 AM
  3. How to check if two circles intersects each other?
    By Mikro in forum C++ Programming
    Replies: 16
    Last Post: 09-01-2004, 09:38 AM
  4. Array of circles
    By Chook in forum C Programming
    Replies: 1
    Last Post: 05-15-2003, 11:12 AM
  5. How to draw circles with DX9?? Please help
    By darcome in forum Game Programming
    Replies: 1
    Last Post: 03-07-2003, 01:00 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21