An electrostatic potential is given by
V = 2.0 r^15 f^14 cos(9)
where V is in Volts, θ is in radians, r is in meters, and f^4 cos(θ) is a function that can be calculated using the following recursive formula:
f^(2n+1) = f^n x f^(n-1) x f^(n+1)
where f^cos = 1 and f^i cos = cos. For instance, to calculate f^2 cos, you would set n = 1 and:
f^(2+1) cos(0) = f^1 cos(0) x f^cos(0) = 2
Write two programs using the recursive formula (select two of the following languages: C++, Python, FORTRAN), to calculate the value of the electric potential at r = 0.82m and θ = π/4 rad at 10 points. Hint: Start by getting the numerical value of f^cos and f^i cos, then use the recursive formula to get f^2, f^3, f^14.