The following mathematics needs to be done, and is very successfully executed when I set the values manually, such as $a1 = 5, $a2 = 9
etc...
$a = [math]::sqrt([math]::pow(($a2-$a7),2)+([math]::pow(($b2+$b7),2)))
$b = [math]::sqrt([math]::pow(($a1-$a7),2)+([math]::pow(($b1+$b7),2)))
$c = [math]::sqrt([math]::pow(($a1-$a2),2)+([math]::pow(($b1-$b2),2)))
$div = 2*[math]::sqrt(([math]::pow($a,2))*([math]::pow($c,2)))
$div_ini = ([math]::pow($a,2))-([math]::pow($b,2))+([math]::pow($c,2))
([math]::acos($div_ini/$div))*180/[math]::pi
But when I try to set the variables in this way: $a1 = Get-Content a1.txt -First 1
Then suddenly it does not work, and just returns NaN.
When I saw this, I checked if the variables even have the numbers set, so I wrote $a1
and yes, the number was there, it's not missing.