Results 1 to 4 of 4

Thread: Point in a circle? Yes or No.

  1. #1

    Thread Starter
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409

    Point in a circle? Yes or No.

    A circle is given: x^2 + y^2 - 2*x - 4*y + 4 = 0

    Now, how do i find out where the point A(2,3) is. What i mean: is it in the circle (not the center) or outside the circle
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  2. #2
    Member
    Join Date
    Nov 2000
    Posts
    62
    I'm not sure about this but I would say just solve the equation:

    x^2 + y^2 - 2*x - 4*y + 4 = 0
    and
    A(2,3)

    to get

    2^2 + 3^2 - 2*2 - 4*3 + 4 = 0

    to find out if it's a solution,
    then you would have to graph the circle somehow.
    It would be alot easier in polar coordinates.
    "As for me, I am poor and needy but God is thinking about me right now." Psalm 40

  3. #3
    Junior Member
    Join Date
    Jun 2001
    Posts
    22
    what you can do is first convert the eq to the notation
    (x-h)^2 + (y-k)^2 = r^2
    where (h,k) is the center and r is the radius

    which comes out to:
    (x-1)^2 + (y-2)^2 = 1

    then given a point A(a,b) check the distance between A and the center of the circle (1,2).
    Then if:
    d<1 : inside circle
    d>1: outside circle
    d=1: on circle

    to check the distance, use the formula:

    d^2 = (x2-x1)^2 + (y2-y1)^2

    --------------------------------------
    so to check the point (2,3) you'd first find the distance:
    d^2 = (2-1)^2 + (3-2)^2 = 1 + 1 = 2
    d=1.414
    1.414>1 therefore, point is outside of circle

  4. #4

    Thread Starter
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Argh! Thanks unformed.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width