|
-
Mar 17th, 2010, 12:59 AM
#1
Thread Starter
Frenzied Member
Cos and the US Measuring System
Hi
In my app i apply cos to a metric variable like so
3.000 / 15 cos
is it the same for feet and inches, eg 3.000m = 9.84251 feet
9.84251 / 15 cos ?
or do i have to convert the degrees to some other type?
thanks
toe
-
Mar 17th, 2010, 01:20 AM
#2
Re: Cos and the US Measuring System
In programs, trig functions (cos, sin, tan, etc.) almost always take their arguments in radians. These are in some sense a more natural system mathematically than degrees. To convert from degrees to radians, multiply by pi/180. That is, if you have 100 degrees, that becomes 100*pi/180 = about 1.74 radians.
This has nothing to do with meters or feet or anything like that. Trig functions *require* degrees or radians as input, which are by definition not units of distance measurement. I'm not sure what you're doing when you say you "apply cos to a metric variable".... Could you be more specific?
Last edited by jemidiah; Mar 17th, 2010 at 01:24 AM.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Mar 17th, 2010, 01:29 AM
#3
Thread Starter
Frenzied Member
Re: Cos and the US Measuring System
What i am doing is getting a horizontal dimension of a roof rafter and applying the fall/angle to get the actual length.
Code:
Public Sub aActualSheetLength()
'cos of sheet length
Dim returnvalue As Double = 0
Const Pl As Double = 3.14159265358979
Dim lLength As Double = 0
lLength = Double.Parse(RoofM2.txtFirstDimension.Text) / 1000 'sheet length
Dim pPitch As Double = CDbl(Form1.ToolStriptxtPitch.Text) 'pitch
Dim tTrueSheetLength As Double = 0.0
RoofM2.txtActualSheetLength.Text = CStr(lLength / Math.Cos(pPitch * (Pl / 180)))
Dim aActualSheetLength As Double = Double.Parse(RoofM2.txtActualSheetLength.Text)
RoofM2.txtActualSheetLength.Text = Math.Round(aActualSheetLength, 3)
End Sub
Basically i just need to know if it is the same formula when using feet and inch's
Of course i need to convert feet and inch's to metric and do the above and then i will output the results back to feet and inch's
regards
toe
-
Mar 17th, 2010, 03:34 AM
#4
Re: Cos and the US Measuring System
If you convert all of your length measurements as you suggest you will, you'll be fine . There's no need to touch anything inside the trig functions for unit conversions, or to change the general format of your equation at all so long as iLength changes its units. The only lines of your code that should have to change at all are iLength = Double.Parse... and (if you want to format your output slightly nicer for English units) the last line.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|