0
$\begingroup$

I'm standing in a circle (Point P), radius of 2000 with a center point 0/0. Then, I'm looking straight to the edge of the circle on a random point (B1 or B2) of the edge. How can I get the distance (f1 or f2) to the point when my rotation/angle is given?

Advanced: What happens if teta is not given, is it still possible to solve it?

Image of Problem

My first tries: Depending on the angle, I'm using sin, cos, tan of my rotation * (the distance to the center point + radius). I tested some numbers and it looks like it's working. Does that makes sense and is there a better solution to solve my problem? It looks like I need several formulas depending on the angle teta and the Position P.

$\endgroup$
  • $\begingroup$ making sure here: you don't wish to find the point on the circle that's closest to you, but the one you're looking at in a particular direction? $\endgroup$ – Dan Uznanski Sep 1 '16 at 4:43
  • $\begingroup$ What do you mean by "my rotation is given"? $\endgroup$ – gambler101 Sep 1 '16 at 4:57
  • $\begingroup$ I recommend drawing a picture. Geogebra is a good tool. It is much easier to understand what you are asking. $\endgroup$ – Ross Millikan Sep 1 '16 at 5:05
  • $\begingroup$ No, this is not a dupe, I updated my question to make the problem more understandable <3. $\endgroup$ – The Hero Sep 1 '16 at 10:24
  • $\begingroup$ You are overcomplicating. Extend your line d so that it forms a diameter of the circle. Your picture will then be the same as that in the answer below, and the answer below will give you either f1 or f2. $\endgroup$ – daniel Sep 1 '16 at 12:21
2
$\begingroup$

If I understand you, the situation is shown below. $g=2000$ is the radius of the circle, $r$ is your distance to the center, $\theta$ is the angle from the radius you are on to the direction you are looking. You want to find $f$. First use the law of sines: $\frac g{\sin \theta}=\frac r{\sin \angle ADC}$ to get $\angle ADC$, then $\angle CAD=\pi-\theta-\angle ADC$ and now use the law of cosines $f^2=r^2+g^2-2rg\cos \angle CAD$

enter image description here

$\endgroup$
  • $\begingroup$ Hey, thanks for the answer <3. I added more information about the problem, I think this is a part of the solution <3. $\endgroup$ – The Hero Sep 1 '16 at 10:21
  • $\begingroup$ @TheHero: I think this is the entire solution and that you have overcomplicated the question. $\endgroup$ – daniel Sep 1 '16 at 12:12
  • $\begingroup$ So basically it is sqrt(square(dc)+square(r)-2*dcrcos(3.14-rot-(sin(rot)/r)*dc)) where dc: distance to center, r: radius and rot: Rotation of myself/angle $\endgroup$ – The Hero Sep 1 '16 at 12:53
  • $\begingroup$ Also, is it sind or sinr, degree or radian? I'm using this to compute a fog in a game, somehow it's not working, I'll share some screens later <3. $\endgroup$ – The Hero Sep 1 '16 at 13:10
  • $\begingroup$ Actually it's degree, my other problem seems to be my calculation of teta. $\endgroup$ – The Hero Sep 1 '16 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.