Newton Raphson method is used to calculate nth root of a number, to find inverse of a number and it has many other applications as well. It is approximation method in calculus where a function is approximated to linear equation and hence nth root is calculated.
I have first discussed the method in detail and then have implemented the method.
The relation which I will be using in
X(n+1) = X(n) - F(X(n))/F`(X(n))
For more details please use the link below
https://en.wikipedia.org/wiki/Newton%...
The code is pasted below.
#PowerShell script to implement Newton Raphson method
#NewtonRaphsonMethod
#SquareRoot
#LinearApproximation
#Calculus
$a = 10
Do{
$a1 = $a - ($a*$a - 410)/(2*$a)
$Diff = $a1 - $a
$Round = [Math]::Round($Diff,1)
$Abs = [Math]::Abs($round)
$a = $a1
$a
}while($Abs -ne 0)