ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help needed to create a formula pls!!! (https://www.excelbanter.com/excel-programming/298939-help-needed-create-formula-pls.html)

Mark[_44_]

Help needed to create a formula pls!!!
 
How do I create a formula to calculate angles, using half the chord dimension and dividing that by the radius then using second function SIN then multiply the answer by 2.

Dana DeLouis[_3_]

Help needed to create a formula pls!!!
 
I believe either of these two equations should give you the angle in
Radians. However, I have used c to represent the full length of the cord,
not half of the cord. Adjust if you wish to enter c/2.

Function FindAngle(r, c) As Double
FindAngle = 2 * WorksheetFunction.Asin(c / (2 * r))
End Function

Function FindAngle(r, c) As Double
On Error Resume Next
FindAngle = 2 * Atn(c / (r * Sqr(4 - (c * c) / (r * r))))
' Check 11: "Division by zero" at 90 Degrees
If Err.Number = 11 Then FindAngle = 4 * Atn(1)
End Function

Here were two quick tests at 180 Deg, and 90 Deg.

Sub TestIt()
' 180 Deg, or 2 Pi
Debug.Print FindAngle(4, 8)
' 90 Deg, or Pi
Debug.Print FindAngle(4, 4 * Sqr(2))
End Sub


HTH.
--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Mark" wrote in message
...
How do I create a formula to calculate angles, using half the chord

dimension and dividing that by the radius then using second function SIN
then multiply the answer by 2.




All times are GMT +1. The time now is 12:13 PM.

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