Jump to content

Find area on a circle between two points AB

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
psr1978

psr1978

    Newbie

  • Members
  • Pip
  • 2 posts
Halo All,

I am new here, and found this as good resource to discuss programming stuff. I have some task to be finished in C or FORTRAN. Briefly, here is the task.

I want to find the all the points lying between two points AB(which are rotating with a constant velocity) on a circle(Please See the Fig.). Until now, i was successful in rotating the two points around a circle but still not able to find a logic to locate only the points which are in between the two points AB.

degree = TIME(2) * velocity ! Get New Angle (Rotating with constant velocity)

RadStrtHtZone = degree * deg2rad ! Convert into DEGREES (POINT A)
RadEndHtZone = (Degree+20)*Deg2Rad ! Convert into DEG. (POINT B) 20° Away from A

NewxS = originx + (cos(StrtPt)*Radius) ! New Position in X-Coordinate of Point A
NewyS = originy + (sin(StrtPt)*Radius) ! New Position in Y-Coordinate of Point A

NewEndxS = originx + (cos(EndPt)*Radius) ! New Position in X-Coord. of Point B
NewEndyS = originy + (sin(EndPt)*Radius) ! New Position in X-Coord. of Point B


I am looking for a LOGIC to find all points lying in between these points. That is, i have a loop on all the points lying on the circle, and i have to choose only the points which lie in between the points A and B.

Any help will be a big step forward for me, and looking forward to hear from you. Thank you in advance....

Attached Files



#2
Aereshaa

Aereshaa

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 790 posts
The point you are on is C. To find out whether you are within <AOB find the <AOC, and if it is smaller than <AOB, then C is between A and B.
Watches: Nanoha, Haruhi, AzuDai. Listens to: E-Type, Dj Melodie, Nightcore.
"When people are wrong they need to be corrected. And then when they can't accept it, an argument ensues." - MeTh0Dz

#3
psr1978

psr1978

    Newbie

  • Members
  • Pip
  • 2 posts
Thank you for the responce. Yes, that is what exactly what i am looking for. I have tried some logics, to find that region, but was not successful. Pseudo code will also be enough.
(The actual problem was, to get the rnge at the peaks of the circle).

Thank you..