void powell_eyink(double* B, double divB) { double alpha = -divB / (2 * dot_product(B, B)); for (int i = 0; i < 3; i++) { B[i] += alpha * B[i]; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter