Transformation of Trig function w = 2*d*tan(a/2)

imk

New member
Joined
Apr 7, 2023
Messages
13
Hello, so my math is poor but i do try!
Now I am interested in calculating the width of a beam when projected at an angle over a distance and I have found the following which tests correctly:
w = 2*d*tan(a/2) where w=width, a=angle and d=distance.
Now I need to transform this to find d or a, so I found the site https://www.symbolab.com/ which has a function transformation page, so I entered
w = 2*d*tan(a/2) to be transformed and have two solutions one of which seems odd.
Solution for d=w/(2*tan(a/2) looks and tests correctly.
Solution for a = 2arctan(w/2*d)+2PIn. Why +2PIn I have no idea what n is and what part it plays in the transformation?
I have however tested a = 2arctan(w/2*d) and it seems correct.
Insight most gracefully received please :)
 
Solution for a = 2arctan(w/2*d)+2PIn. Why +2PIn I have no idea what n is and what part it plays in the transformation?
I have however tested a = 2arctan(w/2*d) and it seems correct.
You asked the site to solve [imath]w=2d\tan\left(\frac{a}{2}\right)[/imath] for [imath]a[/imath]. It found that [imath]\frac{w}{2d}=\tan\left(\frac{a}{2}\right)[/imath], and then it had to take the inverse tangent. That is, what is the angle whose tangent has that value?

But many angles have the same tangent; one of these is called the principal value (what a calculator can find), namely the angle between [imath]-\frac{\pi}{2}[/imath] radians and [imath]\frac{\pi}{2}[/imath] radians; that plus any multiple of [imath]\pi[/imath] radians will also have the same tangent. Adding [imath]n\pi[/imath], for any integer [imath]n[/imath], gives all possible solutions.

Since the last step is to multiply by 2, the result (if you ignore the [imath]2n\pi[/imath]) is an angle between [imath]-\pi[/imath] radians and [imath]\pi[/imath] radians, which is probably what you want. So you can ignore it, just as you did and found it to work.

If you continue to work with problems like this, it would be a good idea to study trigonometry, so you don't have to trust people or software to know exactly what you need!

By the way, it isn't clear to me exactly what you are calculating; if you should want to have your initial formula checked out, you could include a diagram so we could be more sure what your variables mean. But it does make sense for something that sounds like your problem.
 
Hello Dr Peterson, as always many thanks for your help and insight.
I have read and mostly understood your reply. With respect to your reply I think this also clarifies the software function ATAN2.
As far a providing a diagram for clarity, I guess I could have greatly simplified what I am really trying to solve with a few lines. But my real problem is rather complex and based on an array of VL53L5CX Time Of Flight distance sensors each of which has an array of 8x8 zones radiating at 5.625 degrees. I think I mentioned in a previous question, I am building (for retired hobby) an Autonomous Wheel Robot and the problem I was trying to solve was how to calculate a safe passing distance between objects at a distance given the sensors radiating angles. I admit my school boy math was not great then, so in retirement I read a lot and learn a little. But it keeps my mind going and away from dissolving in front of the TV as soo many retires do. Again thanks to all out there that help with my dumb questions. Bless you all :) IanK
PS Very early ERIN can be found at
the next video will be few more months
 
With respect to your reply I think this also clarifies the software function ATAN2.
Yes, ATAN2 is a variation on ATAN (the arctan function) that allows you to find the angle in any quadrant given a point (x, y), whereas arctan(y/x) gives an angle in only the first or fourth quadrant, and needs an adjustment if x is negative, to get the appropriate angle in the second or third quadrants.
 
Top