ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Trigonometry in Excel (https://www.excelbanter.com/excel-discussion-misc-queries/91331-trigonometry-excel.html)

Serge

Trigonometry in Excel
 
A51=25.0
B51=21.5407
C51=42.03 Degrees
In E51
=IF(OR(A51="",B51="",C51=""),0,DEGREES(ATAN(A51*SI N(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))))
The answer is 79.935 Degrees
The formula above works well because the result is less than 90 Degrees
But in the next scenario:
A51=76.673
B51=47.214
C51=9.50 Degrees
I get -24.01 Degrees The answer should be 155.99 Degrees.

Can someone help with this one.
Many Thanks in advance.
Serge

Jerry W. Lewis

Trigonometry in Excel
 
Excel's trig functions work in radians, not degrees. See Help for the
DEGREES() and RADIANS() functions.

Jerry

"Serge" wrote:

A51=25.0
B51=21.5407
C51=42.03 Degrees
In E51
=IF(OR(A51="",B51="",C51=""),0,DEGREES(ATAN(A51*SI N(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))))
The answer is 79.935 Degrees
The formula above works well because the result is less than 90 Degrees
But in the next scenario:
A51=76.673
B51=47.214
C51=9.50 Degrees
I get -24.01 Degrees The answer should be 155.99 Degrees.

Can someone help with this one.
Many Thanks in advance.
Serge


David Biddulph

Trigonometry in Excel
 
"Jerry W. Lewis" wrote in message
...

"Serge" wrote:

A51=25.0
B51=21.5407
C51=42.03 Degrees
In E51
=IF(OR(A51="",B51="",C51=""),0,DEGREES(ATAN(A51*SI N(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))))
The answer is 79.935 Degrees
The formula above works well because the result is less than 90 Degrees
But in the next scenario:
A51=76.673
B51=47.214
C51=9.50 Degrees
I get -24.01 Degrees The answer should be 155.99 Degrees.

Can someone help with this one.


Excel's trig functions work in radians, not degrees. See Help for the
DEGREES() and RADIANS() functions.


He's dealt with the conversion between degrees and radians, Jerry.

The problem is that ATAN returns an angle in the range -pi/2 to +pi/2
radians, not between 0 and +pi, so if we want a positive angle we need to
use
=IF(OR(A51="",B51="",C51=""),0,MOD(DEGREES(ATAN(A5 1*SIN(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))),180))
--
David Biddulph



Serge

Trigonometry in Excel
 
Hello Jerry,
Thanks for your promt reply.
I agree with you. But in the formula shown, the end result is given in
Degrees which is what I want. In first exemple the included angle happens to
be less than 90 degrees.
In the second exemple the result for the included angle is grater than 90
degrees.

"Jerry W. Lewis" wrote:

Excel's trig functions work in radians, not degrees. See Help for the
DEGREES() and RADIANS() functions.

Jerry

"Serge" wrote:

A51=25.0
B51=21.5407
C51=42.03 Degrees
In E51
=IF(OR(A51="",B51="",C51=""),0,DEGREES(ATAN(A51*SI N(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))))
The answer is 79.935 Degrees
The formula above works well because the result is less than 90 Degrees
But in the next scenario:
A51=76.673
B51=47.214
C51=9.50 Degrees
I get -24.01 Degrees The answer should be 155.99 Degrees.

Can someone help with this one.
Many Thanks in advance.
Serge


Serge

Trigonometry in Excel
 
Hello David,
Thanks for your promt reply.
Will this revision work both ways (less than and great than 90 degrees)?
Serge
"David Biddulph" wrote:

"Jerry W. Lewis" wrote in message
...

"Serge" wrote:

A51=25.0
B51=21.5407
C51=42.03 Degrees
In E51
=IF(OR(A51="",B51="",C51=""),0,DEGREES(ATAN(A51*SI N(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))))
The answer is 79.935 Degrees
The formula above works well because the result is less than 90 Degrees
But in the next scenario:
A51=76.673
B51=47.214
C51=9.50 Degrees
I get -24.01 Degrees The answer should be 155.99 Degrees.

Can someone help with this one.


Excel's trig functions work in radians, not degrees. See Help for the
DEGREES() and RADIANS() functions.


He's dealt with the conversion between degrees and radians, Jerry.

The problem is that ATAN returns an angle in the range -pi/2 to +pi/2
radians, not between 0 and +pi, so if we want a positive angle we need to
use
=IF(OR(A51="",B51="",C51=""),0,MOD(DEGREES(ATAN(A5 1*SIN(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))),180))
--
David Biddulph




Serge

Trigonometry in Excel
 
Hello David,

Fantastic, your'e a genious.
Thank you very much. It works both ways.
Serge

"David Biddulph" wrote:

"Jerry W. Lewis" wrote in message
...

"Serge" wrote:

A51=25.0
B51=21.5407
C51=42.03 Degrees
In E51
=IF(OR(A51="",B51="",C51=""),0,DEGREES(ATAN(A51*SI N(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))))
The answer is 79.935 Degrees
The formula above works well because the result is less than 90 Degrees
But in the next scenario:
A51=76.673
B51=47.214
C51=9.50 Degrees
I get -24.01 Degrees The answer should be 155.99 Degrees.

Can someone help with this one.


Excel's trig functions work in radians, not degrees. See Help for the
DEGREES() and RADIANS() functions.


He's dealt with the conversion between degrees and radians, Jerry.

The problem is that ATAN returns an angle in the range -pi/2 to +pi/2
radians, not between 0 and +pi, so if we want a positive angle we need to
use
=IF(OR(A51="",B51="",C51=""),0,MOD(DEGREES(ATAN(A5 1*SIN(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))),180))
--
David Biddulph




SiC

Trigonometry in Excel
 
Hi Serge,

There's nothing wrong with your formula. You used DEGREES() and RADIANS()
correctly. However, the limit for the ATAN function is from -90 to 90
degrees. Both DEGREES(ATAN(TAN(RADIANS(-24.01)))) and
DEGREES(ATAN(TAN(RADIANS(-155.99)))) will give you -24.01. That's just the
nature of the function. If you have to distinguish between -24.01 and
155.99, you just need to some adjustment in your formula. Basically you just
need to check if the value of (B51-A51*COS(RADIANS(C51))) is negative or not.
If it is negative, add 180 degrees to your answer. I trust that you can
figure out that part yourself. Good luck.

-Simon

"Serge" wrote:

A51=25.0
B51=21.5407
C51=42.03 Degrees
In E51
=IF(OR(A51="",B51="",C51=""),0,DEGREES(ATAN(A51*SI N(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))))
The answer is 79.935 Degrees
The formula above works well because the result is less than 90 Degrees
But in the next scenario:
A51=76.673
B51=47.214
C51=9.50 Degrees
I get -24.01 Degrees The answer should be 155.99 Degrees.

Can someone help with this one.
Many Thanks in advance.
Serge


Serge

Trigonometry in Excel
 
Hello Simon,
Thank you for your reply.
Your explanation is very appreciated.
I understand better now.
Thank you very much.
Serge





"SiC" wrote:

Hi Serge,

There's nothing wrong with your formula. You used DEGREES() and RADIANS()
correctly. However, the limit for the ATAN function is from -90 to 90
degrees. Both DEGREES(ATAN(TAN(RADIANS(-24.01)))) and
DEGREES(ATAN(TAN(RADIANS(-155.99)))) will give you -24.01. That's just the
nature of the function. If you have to distinguish between -24.01 and
155.99, you just need to some adjustment in your formula. Basically you just
need to check if the value of (B51-A51*COS(RADIANS(C51))) is negative or not.
If it is negative, add 180 degrees to your answer. I trust that you can
figure out that part yourself. Good luck.

-Simon

"Serge" wrote:

A51=25.0
B51=21.5407
C51=42.03 Degrees
In E51
=IF(OR(A51="",B51="",C51=""),0,DEGREES(ATAN(A51*SI N(RADIANS(C51))/(B51-A51*COS(RADIANS(C51))))))
The answer is 79.935 Degrees
The formula above works well because the result is less than 90 Degrees
But in the next scenario:
A51=76.673
B51=47.214
C51=9.50 Degrees
I get -24.01 Degrees The answer should be 155.99 Degrees.

Can someone help with this one.
Many Thanks in advance.
Serge



All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com