A circle in coordinate

Discussion in 'Homework Help' started by ecjohnny, Sep 12, 2011.

  1. ecjohnny

    Thread Starter Senior Member

    Jul 16, 2005
    142
    0
    [​IMG]



    I need to write a program to get a user input coordinate then check if it falls within the circle. (note: along the circle is consider a circle.)

    My initial though was to compare the coords value of the circle( eg. if 3<x<9 and compare x also then is fall is the square.) then i am left with the diagram on the right of the attach pic 4 little sides.
    my solution might be wrong coz the method of solving worth 2 marks only which i assume would be easy. the rest of marks is programming.

    Anyone has a better solution or help?
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,452
    3,371
    Do you know how to calculate the distance of the point (x,y) from the origin (0,0)?
    Do you know the equation of a circle f(x,y,r)?
    Put the two together for your answer.
     
  3. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,815
    835
    You picture didn't show up. Try going to "Manage Attachments" to upload your picture. Is the circle center always at (0,0)? Do you know what polar coordinates are?
     
  4. ecjohnny

    Thread Starter Senior Member

    Jul 16, 2005
    142
    0
    ok i'll upload a new pic soon. Anyway is is just finding if an entered coordinate is in a circle. and the circle is at the +x and +y (top right)
     
  5. ecjohnny

    Thread Starter Senior Member

    Jul 16, 2005
    142
    0
    yes i know how to calculate the distance. x,y from origin.

    But what does f(x,y,r) mean ?
     
  6. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    He just wants you to consider the equation of a circle. You could also say the equation of a circle looks like R^2=f(x,y) which means that the points on the circle are such that when you plug any x and y coordinate for these points into the function f(x,y) the answer is the radius R squared.

    You can actually solve this without thinking about the distance formula, although the distance formula in built into the equation for a circle. Basically the points inside the circle will obey the relation R^2 ? f(x,y). Where the ? indicates a relational operator; greater than, less than, greater than or equal and less than or equal (>, <, >= or <=). Can you tell which one? So, all you need is the relational operator ?, and the f(x,y) for the circle of interest. The only other circle parameters, other than the radius, are x0 and y0, which indicate the point of the center of the circle.
     
  7. ecjohnny

    Thread Starter Senior Member

    Jul 16, 2005
    142
    0
    Thanks guy i got it...
     
Loading...