﻿ Topic: subtended distance [math]::?(?) | PowerShell.org

# subtended distance [math]::?(?)

Welcome Forums General PowerShell Q&A subtended distance [math]::?(?)

This topic contains 2 replies, has 2 voices, and was last updated by

Participant
1 year, 9 months ago.

• Author
Posts
• #72643

Participant
Points: 0
Rank: Member

Having trouble working with the following math problem.
Distance=cot (64.3/2)*(60/2)

With the following info; 64.30 mils is the angle, 60 meters is the base, solve for distance
On my sr56 calc it was entered like so
64.30/2 x .05625=tan 2nd tan * 60/2=950.16 meters

((64.30/2)*.05625)[decimal][math]::?)*60/2

Thx
bob

• #72679

Participant
Points: 41
Rank: Member

Sorry, I don't understand the math side of it but if you want a cotangent function you derive it from the tangent function:

1/[math]::tan(x)

I'm assuming your trig is correct 🙂 so I guess it would be something like:

Distance = 1/[math]::tan((64.3/2))*(60/2)

Wolfram Alpha and PowerShell give the same answer for that so hopefully that's correct – it's nowhere near 950 meters though...

• #72703

Participant
Points: 0
Rank: Member

Thanks for your help. Your suggestion works with the additional information that [math]::tan(\$angle) is expecting the angle to be in radians but I was giving it the angle in degrees. Adding \$vAngleInDegrees / 180 * [math]::PI fixed that.
I guess its just me but I was surprised I didn't find any powershell examples of subtended distance.
On the off chance someone else may find it helpful.

\$vSubtendedDistance=((1/([decimal][math]::Tan((\$vAngleInDegrees / 180 * [math]::PI))))*\$vBase/2)

The topic ‘subtended distance [math]::?(?)’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort