subtended distance [math]::?(?)

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

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 :slight_smile: 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…

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)