How convert a point on an X and Y grid to a angle degree?

Click For Summary
SUMMARY

This discussion focuses on converting a point on an X and Y grid into an angle degree, specifically for the line equation y = ax. The key takeaway is that the slope of the line, represented by the coefficient "a," is equal to the tangent of the angle (tan(θ)). To find the angle, one must use the inverse tangent function (arctan). For instance, if a = 2, then θ = arctan(2), which equals approximately 63.4 degrees.

PREREQUISITES
  • Understanding of basic trigonometric functions, specifically tangent and inverse tangent.
  • Familiarity with linear equations and their graphical representation.
  • Knowledge of coordinate systems and how to plot points on a grid.
  • Basic programming skills in C++ for visualizing the problem (optional).
NEXT STEPS
  • Learn about the relationship between slope and angle in linear equations.
  • Study the properties of the tangent function and its inverse.
  • Explore how to implement trigonometric calculations in C++.
  • Investigate applications of angle conversion in real-world scenarios, such as time representation on circular graphs.
USEFUL FOR

Mathematicians, physics students, software developers working with graphical representations, and anyone interested in understanding the relationship between linear equations and angles.

Xarzu
<Moderator's note: Moved from a technical forum and thus no template.>

Hello Forum,

This post is a spin-off from this post:

https://www.physicsforums.com/threa...een-watching-the-sun-set.925257/#post-5840279

If I have an X and Y point on a grid that represents the intersection of two formulas: A straight line (aX = Y) where "a" represents a constant number with a circle (X 2 + Y 2 = radius 2, how would I convert that point into a degree of an angle? The angle would represent the line function albeit only go one direction on the grid. It would be some degree.

If I were to guess, this might be very simple and have something to do with cosine rules.
 
Last edited by a moderator:
Physics news on Phys.org
Yes. Have you drawn the situation? And what do you know about how cosine and sine are defined?
 
fresh_42 said:
Yes. Have you drawn the situation? And what do you know about how cosine and sine are defined?
I have an X and Y point of intersection. Yes, I have drawn the situation thanks to a C++ program (if you are following the other thread). Anyway, it is just a line going out from the middle of the grid now. I want to convert this line to an angle somehow. How do I do that? If it were an angle, then this would help me to convert into time since the circle represents a 24 hour period. Any ideas?

I am not really sure what you mean.
 
Xarzu said:
If I have an X and Y point on a grid that represents the intersection of two formulas: A straight line (aX = Y) where "a" represents a constant number with a circle (X2 + Y2 = radius2, how would I convert that point into a degree of an angle? The angle would represent the line function albeit only go one direction on the grid. It would be some degree.
It sounds like you're trying to find the angle that the line y = ax makes with the horizontal, so the circle isn't needed at all.
The coefficient a represents the slope of the line, where slope = tangent(angle).

For example, the line y = 2x has a slope of 2, so ##2 = tan(\theta)##, with ##\theta## being often used to represent an angle.
Take the inverse tangent (##\tan^{-1}## or ##\arctan##) of both sides to get
##\tan^{-1}(2) = \theta##. In degrees, ##\theta## is about 63.4°.
 
  • Like
Likes Xarzu
Thank you for the answer. I will apply it now.
:smile:
 

Similar threads

Replies
17
Views
3K
Replies
7
Views
2K
Replies
20
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K