I want to know how to get an angle of a line A-B from horizontal axis X. Other questions in SO do that only between two lines. I'm aware I can always draw second line A-C and calculate but I'm wondering if there's a faster method.
EDIT: I'm very sure I'm not doing a premature optimization.
Angle = ArcCos(R / R+h). for heights h in feet. The result will typically be good to 0.01 degree (except at the extremes of 25,000 and 41,000 feet, where it's off almost 0.02 degrees). E.g., with h = 33,293 feet, the angle should be around 1.5924 + 0.048892 * (33.293) = 3.22 degrees.
@akashg: 90 - angleInDegrees ?
You can use atan
for that.
angle = atan((By-Ay)/(Bx-Ax))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With