Blog Entry © Saturday – Tuesday, May 30 – June 2, 2026, by James Pate Williams, Jr., theMicrosoft Bing Copilot, the M365 Copilot Partial Reproduction of Figures 8 and 9 fromChapter 2 of Quantum Mechanics Third Edition by Leonard I. Schiff

class Figure
{
public:
	static void ComputeFigure(
		bool eight,
		double& xi2, double& eta2,
		std::vector<double>& radius,
		std::vector<double>& xi,
		std::vector<double>& eta,
		std::vector<double>& vix,
		std::vector<double>& viy,
		std::vector<double>& energy1,
		double (*f)(double),
		double (*g)(double));
};

#include "Figure.h"
#include <algorithm>
#include <cmath>
#include <iterator>
#include <set>
#include <vector>

// Function to compute intersection of two sorted containers of doubles with tolerance
template <typename InputIt1, typename InputIt2, typename OutputIt>
void set_intersection_with_tolerance(InputIt1 first1, InputIt1 last1,
	InputIt2 first2, InputIt2 last2,
	OutputIt d_first, double tolerance) {
	while (first1 != last1 && first2 != last2) {
		double a = *first1;
		double b = *first2;

		if (std::fabs(a - b) <= tolerance) {
			// Values are considered equal within tolerance
			*d_first++ = /*a; // or */ (a + b) / 2.0; //if you want averaged value
			++first1;
			++first2;
		}
		else if (a < b - tolerance) {
			++first1;
		}
		else {
			++first2;
		}
	}
}

static double f(double xi)
{
	return xi * tan(xi);
}

static double g(double xi)
{
	return -xi * 1.0 / tan(xi);
}

static void Intersection(
	bool eight, std::vector<double>& intersection)
{
	double del = 0.0, radius2 = 0.0;
	double tolerance = 0.0;
	double (*h)(double);
	int ilimit = 0;
	std::set<double> eta, rad;

	if (eight)
	{
		ilimit = 10000;
		radius2 = 1.0;
		tolerance = 1.0e-1;
		h = f;
	}

	else
	{
		ilimit = 10000;
		radius2 = 4.0;
		tolerance = 1.0e-1;
		h = g;
	}

	del = radius2 / ilimit;
	intersection.clear();

	for (size_t i = 0; i < ilimit; i++)
	{
		double xi0 = i * del;

		if (eight && xi0 >= 0.65)
		{
			double et = h(xi0);
			double r2 = xi0 * xi0 + et * et;
			
			if (fabs(r2 - radius2) < tolerance)
			{
				eta.insert(et);
				rad.insert(r2);
			}
		}

		else if (!eight && xi0 >= 1.8125)
		{
			double et = h(xi0);
			double r2 = xi0 * xi0 + et * et;

			if (fabs(r2 - radius2) < tolerance)
			{
				eta.insert(et);
				rad.insert(r2);
			}
		}
	}

	if (eight)
	{
		size_t count = 0, index = 0;

		for (double val : eta)
		{
			if (index == eta.size() - 1)
			{
				intersection.push_back(val);
				break;
			}

			count++;
			index++;
		}
	}

	else
	{
		int count = 24, index = 0;

		for (double val : eta)
		{
			if (index == eta.size() - count)
			{
				intersection.push_back(val);
				break;
			}

			index++;
		}
	}

	/*set_intersection_with_tolerance(
		eta.begin(), eta.end(),
		rad.begin(), rad.end(),
		std::back_inserter(intersection),
		tolerance);*/
}

void Figure::ComputeFigure(
	bool eight,
	double& xi2, double& eta2,
	std::vector<double>& radius,
	std::vector<double>& xi,
	std::vector<double>& eta,
	std::vector<double>& vix,
	std::vector<double>& viy,
	std::vector<double>& intersection,
	double (*f)(double),
	double (*g)(double))
{
	double xi0 = 0.0;
	double xi1 = 3.5;
	double eta0 = 0.0, eta1 = 0.0;
	double (*h)(double);

	xi.clear();
	eta.clear();

	if (eight)
		h = f;
	else
	{
		xi0 = 1.5;
		h = g;
	}

	eta0 = h(xi0);
	eta1 = h(xi1);

	double deltaXi = (xi1 - xi0) / 10000.0;
	int count = 0;

	vix.clear();
	viy.clear();

	for (int j = 0; j <= 10000; j++)
	{
		double x = j * deltaXi;
		double hx = h(x);
		double vx = x * x + hx * hx;

		if (eight && x >= xi0 && x <= xi1)
		{
			if (count == 0 && x >= xi0)
			{
				xi.push_back(x);
				eta.push_back(hx);
				count = 1;
			}

			else
			{
				xi.push_back(x);
				eta.push_back(hx);
			}

			for (int k = 0; k < 2; k++)
			{
				double r = radius[k];

				vix.push_back(xi[xi.size() - 1]);
				viy.push_back(r * r);
			}
		}

		else if (!eight && x >= xi0 && x <= xi1)
		{
			if (count == 0 && x >= xi0)
			{
				xi.push_back(x);
				eta.push_back(hx);
				count = 1;
			}

			else if (count == 1)
			{
				xi.push_back(x);
				eta.push_back(hx);
			}

			if (xi.size() > 0)
			{
				for (int k = 0; k < 1; k++)
				{
					double r = radius[k];

					vix.push_back(xi[xi.size() - 1]);
					viy.push_back(r * r);
				}
			}
		}

		if (eight && xi[j] >= 0.0 && eta[j] >= 3.5)
			break;
		
		else if (!eight &&
			xi.size() > 0 &&
			xi[xi.size() - 1] > 1.5 &&
			eta.size() > 0 &&
			eta[eta.size() - 1] >= 3.5)
			break;
	}
	
	Intersection(eight, intersection);
}

// SchiffChapter2Fig8and9.cpp : Defines the entry point for the application.
//

#include "framework.h"
#include "SchiffChapter2Fig8and9.h"
#include <time.h>
#include <algorithm>
#include <vector>
#include "Figure.h"

#define MAX_LOADSTRING 100

typedef struct tagPoint2d
{
    double x, y;
} Point2d, * PPoint2d;

// Global Variables:
HINSTANCE hInst;                                // current instance
WCHAR szTitle[MAX_LOADSTRING];                  // The title bar text
WCHAR szWindowClass[MAX_LOADSTRING];            // the main window class name
WCHAR line[8192], text[8192];                   // wide character buffers
WCHAR title[65536];                             // window title
bool eight;                                     // true = plot figure 8
double xi2, eta2;                               // energy cordinates
std::vector<Point2d> points;                    // plotting 2d points
std::vector<double> radius;                     // radius vector { 1.0, 2.0 }
std::vector<double> xi;                         // Greek x-coordinate
std::vector<double> eta;                        // Greek y-coordinate
std::vector<double> V0;                         // potential of the well
std::vector<double> vix;                        // potential x-coordinate
std::vector<double> viy;                        // potential y-coordinate
std::vector<double> energy1;                    // energy eigenvalues

// Forward declarations of functions included in this code module:
ATOM                MyRegisterClass(HINSTANCE hInstance);
BOOL                InitInstance(HINSTANCE, int);
LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK    DrawEtaDialog(HWND, UINT, WPARAM, LPARAM);

int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPWSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

    // TODO: Place code here.

    // Initialize global strings
    LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
    LoadStringW(hInstance, IDC_SCHIFFCHAPTER2FIG8AND9, szWindowClass, MAX_LOADSTRING);
    MyRegisterClass(hInstance);

    // Perform application initialization:
    if (!InitInstance (hInstance, nCmdShow))
    {
        return FALSE;
    }

    HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SCHIFFCHAPTER2FIG8AND9));

    MSG msg;

    // Main message loop:
    while (GetMessage(&msg, nullptr, 0, 0))
    {
        if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }

    return (int) msg.wParam;
}

//
//  FUNCTION: MyRegisterClass()
//
//  PURPOSE: Registers the window class.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
    WNDCLASSEXW wcex = { 0 };

    wcex.cbSize = sizeof(WNDCLASSEX);

    wcex.style          = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc    = WndProc;
    wcex.cbClsExtra     = 0;
    wcex.cbWndExtra     = 0;
    wcex.hInstance      = hInstance;
    wcex.hIcon          = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SCHIFFCHAPTER2FIG8AND9));
    wcex.hCursor        = LoadCursor(nullptr, IDC_ARROW);
    wcex.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
    wcex.lpszMenuName   = MAKEINTRESOURCEW(IDC_SCHIFFCHAPTER2FIG8AND9);
    wcex.lpszClassName  = szWindowClass;
    wcex.hIconSm        = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

    return RegisterClassExW(&wcex);
}

//
//   FUNCTION: InitInstance(HINSTANCE, int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function, we save the instance handle in a global variable and
//        create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   hInst = hInstance; // Store instance handle in our global variable

   HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);

   if (!hWnd)
   {
      return FALSE;
   }

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return TRUE;
}

static double fx(double x)
{
    return x * tan(x);
}

static double gx(double x)
{
    return -x * 1.0 / tan(x);
}

//
//  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  PURPOSE: Processes messages for the main window.
//
//  WM_COMMAND  - process the application menu
//  WM_PAINT    - Paint the main window
//  WM_DESTROY  - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
    case WM_COMMAND:
        {
            int wmId = LOWORD(wParam);
            // Parse the menu selections:
            switch (wmId)
            {
            case IDM_ABOUT:
                DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
                break;
            case IDM_FIGURE8:
            {
                eight = true;
                text[0] = L'\0';

                clock_t clock0 = clock();
                radius.push_back(1.0);
                radius.push_back(2.0);
                Figure::ComputeFigure(
                    eight, xi2, eta2, radius, xi, eta, vix, viy, energy1, fx, gx);
                clock_t clock1 = clock() - clock0;
                double runtime = (double)clock1 / CLOCKS_PER_SEC;
                swprintf_s(line, 8192, L"Runtime in Seconds = %lf\r\n", runtime);
                wcscat_s(text, 8192, line);

                points.clear();
               
                for (size_t j = 0; j < xi.size(); j++)
                {
                    Point2d pt = { 0 };
                    pt.x = xi[j];
                    pt.y = eta[j];
                    points.push_back(pt);
                }
                
                for (size_t i = 0; i < energy1.size(); i++)
                {
                    swprintf_s(line, 8192, 
                        L"E[%zu] = %lf\r\n", i, energy1[i]);
                    wcscat_s(text, 8192, line);
                }

                MessageBox(hWnd, text, L"Energy Information",
                    MB_OK | MB_ICONINFORMATION);

                DialogBox(hInst, MAKEINTRESOURCE(IDD_DRAW_ETA_DIALOG), hWnd, DrawEtaDialog);
                break;
            }
            case IDM_FIGURE9:
            {
                eight = false;
                text[0] = L'\0';

                clock_t clock0 = clock();
                radius.push_back(2.0);
                Figure::ComputeFigure(
                    eight, xi2, eta2, radius, xi, eta, vix, viy, energy1, fx, gx);
                clock_t clock1 = clock() - clock0;
                double runtime = (double)clock1 / CLOCKS_PER_SEC;
                swprintf_s(line, 8192, L"Runtime in Seconds = %lf\r\n", runtime);
                wcscat_s(text, 8192, line);

                points.clear();
                
                for (size_t j = 0; j < xi.size(); j++)
                {
                    Point2d pt = { 0 };
                    pt.x = xi[j];
                    pt.y = eta[j];
                    points.push_back(pt);
                }

                for (size_t i = 0; i < energy1.size(); i++)
                {
                    swprintf_s(line, 8192,
                        L"E[%zu] = %lf\r\n", i, energy1[i]);
                    wcscat_s(text, 8192, line);
                }

                MessageBox(hWnd, text, L"Energy Information",
                    MB_OK | MB_ICONINFORMATION);

                DialogBox(hInst, MAKEINTRESOURCE(IDD_DRAW_ETA_DIALOG), hWnd, DrawEtaDialog);
                break;
            }
            case IDM_EXIT:
                DestroyWindow(hWnd);
                break;
            default:
                return DefWindowProc(hWnd, message, wParam, lParam);
            }
        }
        break;
    case WM_PAINT:
        {
            PAINTSTRUCT ps;
            HDC hdc = BeginPaint(hWnd, &ps);
            // TODO: Add any drawing code that uses hdc here...
            EndPaint(hWnd, &ps);
        }
        break;
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}

// Message handler for about box.
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);
    switch (message)
    {
    case WM_INITDIALOG:
        return (INT_PTR)TRUE;

    case WM_COMMAND:
        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
        {
            EndDialog(hDlg, LOWORD(wParam));
            return (INT_PTR)TRUE;
        }
        break;
    }
    return (INT_PTR)FALSE;
}

static void FindMinMax(
    std::vector<Point2d>& points,
    double& xMin, double& xMax,
    double& yMin, double& yMax)
{
    // uses global 2D double points structure

    xMin = yMin = DBL_MAX;
    xMax = yMax = DBL_MIN;

    for (size_t i = 0; i < points.size(); i++)
    {
        Point2d pt = points[i];
        double x = pt.x;
        double y = pt.y;

        if (x < xMin)
            xMin = x;
        if (x > xMax)
            xMax = x;
        if (y < yMin)
            yMin = y;
        if (y > yMax)
            yMax = y;
    }
}

static void DrawFormattedText(HDC hdc, char text[], RECT rect)
{
    // Draw the text with formatting options
    DrawTextA(hdc, text, -1, &rect, DT_SINGLELINE | DT_NOCLIP);
}

static void DrawQuarterCircleArc(
    HDC hdc,
    float xSlope, float ySlope,
    float xInter, float yInter,
    float radius, bool topToRight)
{
    auto mapX = [&](float x)
        {
            return (int)lroundf(xSlope * x + xInter);
        };

    auto mapY = [&](float y)
        {
            return (int)lroundf(ySlope * y + yInter);
        };

    int x1 = mapX(-radius);
    int y1 = mapY(+radius);
    int x2 = mapX(+radius);
    int y2 = mapY(-radius);

    int left = min(x1, x2);
    int right = max(x1, x2);
    int top = min(y1, y2);
    int bottom = max(y1, y2);

    int xTop = mapX(0.0f);
    int yTop = mapY(radius);

    int xRight = mapX(radius);
    int yRight = mapY(0.0f);

    if (topToRight)
    {
        Arc(hdc, left, top, right, bottom,
            xTop, yTop, xRight, yRight);
    }

    else
    {
        Arc(hdc, left, top, right, bottom,
            xRight, yRight, xTop, yTop);
    }
}

INT_PTR CALLBACK DrawEtaDialog(
    HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);
    switch (message)
    {
    case WM_INITDIALOG:
        SetWindowText(hDlg, title);
        return (INT_PTR)TRUE;
    case WM_COMMAND:
        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
        {
            EndDialog(hDlg, LOWORD(wParam));
            return (INT_PTR)TRUE;
        }
        break;
    case WM_PAINT:
        double h = 0, pi = 0, plm = 0, theta = 0;
        double xMax = 0, xMin = 0, yMax = 0, yMin = 0;
        FindMinMax(points, xMin, xMax, yMin, yMax);
        float xSpan = (float)(xMax - xMin);
        float ySpan = (float)(yMax - yMin);
        RECT rect = { };
        GetClientRect(hDlg, &rect);
        float width = (float)(rect.right - rect.left + 1);
        float height = (float)(rect.bottom - rect.top - 32 + 1);
        float sx0 = 2.0f * width / 16.0f;
        float sx1 = 14.0f * width / 16.0f;
        float sy0 = 2.0f * height / 16.0f;
        float sy1 = 14.0f * height / 16.0f;
        float deltaX = xSpan / 8.0f;
        float deltaY = ySpan / 8.0f;
        float xSlope, xInter, ySlope, yInter;
        xSlope = (sx1 - sx0) / xSpan;
        xInter = (float)(sx0 - xSlope * xMin);
        ySlope = (sy0 - sy1) / ySpan;
        yInter = (float)(sy0 - ySlope * yMax);
        float px = 0, py = 0, sx = 0, sy = 0;
        float vx = 0, vy = 0;
        PAINTSTRUCT ps;
        POINT wPt = { };
        HDC hdc = BeginPaint(hDlg, &ps);
        int i = 0;
        float x = (float)xMin;
        float y = (float)yMax;
        px = x;
        py = y;
        sx = xSlope * px + xInter;
        sy = ySlope * py + yInter;
        MoveToEx(hdc, (int)sx, (int)sy0, &wPt);
        char buffer[128] = { };

        while (i <= 8)
        {
            sx = xSlope * x + xInter;
            wPt.x = wPt.y = 0;
            MoveToEx(hdc, (int)sx, (int)sy0, &wPt);
            LineTo(hdc, (int)sx, (int)sy1);

            sprintf_s(buffer, "%5.4lf", x);
            SIZE size = { };
            GetTextExtentPoint32A(
                hdc,
                buffer,
                (int)strlen(buffer),
                &size);
            RECT textRect = { };
            textRect.left = (long)(sx - size.cx / 2.0f);
            textRect.right = (long)(sx + size.cx / 2.0f);
            textRect.top = (long)sy1;
            textRect.bottom = (long)(sy1 + size.cy / 2.0f);
            DrawFormattedText(hdc, buffer, textRect);
            x += deltaX;
            i++;
        }

        i = 0;
        y = (float)yMin;

        while (i <= 8)
        {
            sy = ySlope * y + yInter;
            wPt.x = wPt.y = 0;
            MoveToEx(hdc, (int)sx0, (int)sy, &wPt);
            LineTo(hdc, (int)sx, (int)sy);

            if (i != 0)
            {
                sprintf_s(buffer, "%5.3lf", y);
                SIZE size = { };
                GetTextExtentPoint32A(
                    hdc,
                    buffer,
                    (int)strlen(buffer),
                    &size);
                RECT textRect = { };
                textRect.left = (long)(sx0 - size.cx - size.cx / 5.0f);
                textRect.right = (long)(sx0 - size.cx / 2.0f);
                textRect.top = (long)(sy - size.cy / 2.0f);
                textRect.bottom = (long)(sy + size.cy / 2.0f);
                DrawFormattedText(hdc, buffer, textRect);
            }

            y += deltaY;
            i++;
        }

        HGDIOBJ bPenNew = NULL;
        HGDIOBJ hPenOld = NULL;

        bPenNew = CreatePen(PS_SOLID, 2, RGB(0, 0, 255));
        hPenOld = SelectObject(hdc, bPenNew);

        HRGN hrgn = CreateRectRgn((int)sx0, (int)sy0, (int)sx1, (int)sy1);
        
        // Select the clipping region into the DC
        if (SelectClipRgn(hdc, hrgn) == ERROR) {
            MessageBox(hDlg, L"Failed to select clip region", 
                L"Error", MB_ICONERROR);
            return (INT_PTR)FALSE;
        }

        SelectClipRgn(hdc, hrgn);

        px = (float)points[0].x;
        py = (float)points[0].y;
        sx = xSlope * px + xInter;
        sy = ySlope * py + yInter;
        wPt.x = wPt.y = 0;
        MoveToEx(hdc, (int)sx, (int)sy, &wPt);

        for (size_t j = 1; j < points.size(); j++)
        {
            px = (float)points[j].x;
            py = (float)points[j].y;
            sx = xSlope * px + xInter;
            sy = ySlope * py + yInter;
            LineTo(hdc, (int)sx, (int)sy);
        }

        float radius = 0.0f;

        if (eight)
            radius = 1.0f;
        else
            radius = 2.0f;

        DrawQuarterCircleArc(
            hdc, xSlope, ySlope,
            xInter, yInter, radius, false);

        if (eight)
        {
            radius = 2.0f;

            DrawQuarterCircleArc(
                hdc, xSlope, ySlope,
                xInter, yInter, radius, false);
        }

        SelectObject(hdc, hPenOld);
        DeleteObject(bPenNew);

        return (INT_PTR)FALSE;
    }

    return (INT_PTR)FALSE;
}

Blog Entry © Thursday, May 28, 2026, by James Pate Williams, Jr. and Microsoft’s Copilot Solution of the Potential Equation in Rectangle using Fixed Point Iteration in Python

# NOTE:
# This implementation prioritizes clarity and correctness over optimization.
# Further performance improvements can be made if needed.
# (c) May 26, 2026 by James Pate Willims, Jr.
# I had some help from the Microsoft Copilot
# to calculate runtimes and define matrices
# Computes the potential in a rectangle
# Reference: "Boundary Value Problems
# Second Edition" by David L. Powers
# See pages 179 to 182 for the analytic
# solution of this Laplace Equation
# Stand alone application using
# Microsoft Visual Studio 2022
# Community Version

import math
import time

xi = yi = 10
u = [[0.0 for _ in range(xi + 2)] for _ in range(yi + 2)]
v = [[0.0 for _ in range(xi + 2)] for _ in range(yi + 2)]

def ComputeBoundaryValues(x, y):
    if x == 0:
        return 0
    if x == 1:
        return 0
    if y == 0 or y == 1:
        if x > 0.0 and x < 0.5:
            return 2.0 * x
        elif x >= 0.5 and x < 1.0:
            return 2.0 - 2.0 * x
                 
    return 0.0

def ComputeParams(its, norm, params):
    params['iterations'] = its
    params['norm'] = norm

def Compute(h, k, xi, yi, maxIts, params):
    # Use a simple fixed-point iteration to
    # compute an approximate solution
    for i in range(0, xi + 1):
        for j in range(0, yi + 1):
            u[i][j] = ComputeBoundaryValues(i * h, j * k)

    for its in range(1, maxIts + 1):
        for i in range(1, xi):
            for j in range(1, yi): 
                u[i][j] = 0.25 * (u[i + 1][j] + u[i - 1][j] + u[i][j + 1] + u[i][j - 1]);

    norm = 0

    for i in range(0, xi + 1):
        for j in range(0, yi + 1):
            norm += math.fabs(u[i][j] * u[i][j])

    norm = math.sqrt(norm)
    params['iterations'] = its
    params['norm'] = norm

def f(x, y):
    # Analytic solution series expansion n = 1 to 100 
    sum = 0.0

    for n in range(1, 101):
        factor1 = math.sin(n * math.pi / 2.0) / (n * n)
        factor2 = math.sinh(n * math.pi * y)
        factor3 = math.sinh(n * math.pi * (1 - y))
        factor4 = math.sin(n * math.pi * x)
        term = (factor2 + factor3) / math.sinh(n * math.pi)
        sum += factor1 * term * factor4
    return 8.0 * sum / (math.pi * math.pi)

avgPE = 0
deltaX = 1.0 / xi
deltaY = 1.0 / yi
maxIts = 50
start_time = time.perf_counter()

for i in range(0, xi + 1):
    for j in range(0, yi + 1):
        v[i][j] = f(i * deltaX, j * deltaY)

minPE = +1000000000
maxPE = -1000000000
params = {}

Compute(deltaX, deltaY, xi, yi, maxIts, params)
print("Approximate\tAnalytic\tPercent Error")

for i in range(0, xi + 1):
    for j in range(0, yi + 1):
        if (math.fabs(u[i][j]) > 1.0e-12 and
            math.fabs(v[i][j]) > 1.0e-12):
            pe = 100.0 * math.fabs((v[i][j] - u[i][j]) / v[i][j])
        else:
            pe = 0.0

        avgPE += pe

        if (pe < minPE):
            minPE = pe

        if (pe > maxPE):
            maxPE = pe

        if math.fabs(pe) != 0.0:
            print("{:10.8f}".format(u[i][j]), "\t", "{:10.8f}".format(v[i][j]), "\t", "{:10.8f}".format(pe))

avgPE /= (xi * yi)
end_time = time.perf_counter()
# Calculate elapsed time in milliseconds
elapsed_ms = (end_time - start_time) * 1000

print("Iterations = ", params['iterations'])
print("Frobenius Norm = ", params['norm'])
print("Minimum Percent Error = ", "{:10.8f}".format(minPE))
print("Average Percent Error = ", "{:10.8f}".format(avgPE))
print("Maximum Percent Error = ", "{:10.8f}".format(maxPE))
print("Elapsed Milliseconds  = ", "{:10.8f}".format(elapsed_ms))

Approximate     Analytic        Percent Error
0.20000000 0.19999972 0.00013831
0.16633455 0.16663592 0.18085704
0.13739427 0.13768928 0.21425509
0.11591159 0.11605132 0.12040154
0.10292732 0.10291871 0.00836375
0.09864668 0.09854114 0.10710198
0.10305612 0.10291871 0.13351975
0.11613103 0.11605132 0.06868445
0.13763395 0.13768928 0.04018144
0.16650309 0.16663592 0.07971563
0.20000000 0.19999972 0.00013831
0.40000000 0.39999927 0.00018169
0.32813882 0.32854798 0.12453472
0.26763492 0.26776105 0.04710489
0.22369849 0.22344522 0.11334607
0.19755216 0.19705465 0.25246951
0.18899096 0.18834090 0.34515051
0.19778524 0.19705465 0.37075402
0.22409557 0.22344522 0.29105301
0.26806863 0.26776105 0.11486989
0.32844379 0.32854798 0.03171204
0.40000000 0.39999927 0.00018169
0.60000000 0.59999811 0.00031532
0.47888974 0.47875999 0.02710181
0.38176991 0.38059768 0.30799710
0.31425594 0.31267225 0.50650231
0.27518847 0.27354681 0.60013876
0.26255192 0.26082096 0.66365837
0.27549367 0.27354681 0.71170992
0.31477587 0.31267225 0.67278721
0.38233779 0.38059768 0.45720485
0.47928905 0.47875999 0.11050679
0.60000000 0.59999811 0.00031532
0.80000000 0.79999202 0.00099701
0.60602379 0.60222488 0.63081180
0.46685956 0.46199176 1.05365615
0.37704317 0.37308607 1.06063957
0.32711029 0.32392135 0.98448025
0.31121899 0.30818168 0.98555933
0.32745161 0.32392135 1.08985035
0.37762462 0.37308607 1.21648870
0.46749464 0.46199176 1.19112076
0.60647034 0.60222488 0.70496220
0.80000000 0.79999202 0.00099701
1.00000000 0.99594729 0.40692036
0.67874673 0.65811281 3.13531720
0.50319768 0.49282441 2.10486107
0.40066316 0.39470092 1.51057096
0.34574699 0.34157202 1.22228048
0.32848272 0.32468552 1.16950228
0.34608839 0.34157202 1.32223096
0.40124475 0.39470092 1.65792212
0.50383291 0.49282441 2.23375660
0.67919339 0.65811281 3.20318626
1.00000000 0.99594729 0.40692036
0.80000000 0.79999202 0.00099701
0.60615279 0.60222488 0.65223206
0.46709299 0.46199176 1.10418350
0.37734885 0.37308607 1.14257161
0.32745218 0.32392135 1.09002599
0.31156100 0.30818168 1.09653477
0.32776105 0.32392135 1.18538026
0.37787503 0.37308607 1.28360546
0.46766769 0.46199176 1.22857864
0.60655688 0.60222488 0.71933113
0.80000000 0.79999202 0.00099701
0.60000000 0.59999811 0.00031532
0.47910949 0.47875999 0.07300025
0.38216756 0.38059768 0.41247566
0.31477665 0.31267225 0.67303766
0.27577086 0.27354681 0.81304189
0.26313452 0.26082096 0.88702848
0.27602079 0.27354681 0.90440981
0.31520243 0.31267225 0.80920943
0.38263258 0.38059768 0.53465917
0.47943646 0.47875999 0.14129609
0.60000000 0.59999811 0.00031532
0.40000000 0.39999927 0.00018169
0.32837881 0.32854798 0.05149022
0.26806920 0.26776105 0.11508237
0.22426717 0.22344522 0.36785094
0.19818820 0.19705465 0.57524397
0.18962723 0.18834090 0.68297865
0.19836093 0.19705465 0.66290001
0.22456142 0.22344522 0.49953914
0.26839057 0.26776105 0.23510691
0.32860478 0.32854798 0.01728752
0.40000000 0.39999927 0.00018169
0.20000000 0.19999972 0.00013831
0.16650327 0.16663592 0.07960469
0.13769959 0.13768928 0.00748883
0.11631140 0.11605132 0.22411146
0.10337449 0.10291871 0.44285504
0.09909401 0.09854114 0.56105764
0.10346087 0.10291871 0.52678322
0.11645855 0.11605132 0.35090580
0.13786030 0.13768928 0.12420922
0.16661627 0.16663592 0.01179315
0.20000000 0.19999972 0.00013831
Iterations = 50
Frobenius Norm = 4.028216200275417
Minimum Percent Error = 0.00000000
Average Percent Error = 0.54286140
Maximum Percent Error = 3.20318626
Elapsed Milliseconds = 36.23520000
Press any key to continue . . .

Blog Entry (c) Tuesday, May 26, 2026, by James Pate Williams, Jr. and Microsoft’s Copilot Hydrogen-Like Atomic Radial Wave Functions

Included a downloadable PDF and Microsoft Excel Workbook.

Blog Entry (c) Monday, May 25, 2026, by James Pate Williams, Jr. Quantum Mechanical Linear Harmonic Oscillator

Blog Entry © Monday, May 11, 2026, by James Pate Williams, Jr., Laplace Equation in a Solid Cylinder

Blog Entry © Monday, April 20, 2026, by James Pate Williams, Jr., Vector Analysis Continued and Perhaps Corrected

Blog Entry © Sunday, April 19, 2026, by James Pate Williams, Jr., Scattering from a Spherically Symmetric Potential

Vector Analysis by James Pate Williams, Jr. Exercises and Supplementary Problems from Introduction to Vector Analysis Fourth Edition© 1979 by Harry F. Davis and Arthur David Snider Selected Exercises from Chapter 1 Pages 48 and 50

// VectorAnalysis.cpp © Tuesday, April 14, 2026
// by James Pate Williams, Jr.
// Reference: Introduction to Vector Analysis Fourth Edition
// © 1979 by Harry F. Davis and Arthur David Snider 

#include <iostream>
#include <vector>

static double InnerProduct(
	std::vector<double> A,
	std::vector<double> B,
	int n)
{
	double sum = 0.0;

	for (int i = 0; i < n; i++)
		sum += A[i] * B[i];

	return sum;
}

static void VectorProduct(
	std::vector<double> A,
	std::vector<double> B,
	std::vector<double>&C)
{
	C.resize(3);
	C[0] = A[1] * B[2] - A[2] * B[1];
	C[1] = A[2] * B[0] - A[0] * B[2];
	C[2] = A[0] * B[1] - A[1] * B[0];
}

static double TripleProduct(
	std::vector<double> A,
	std::vector<double> B,
	std::vector<double> C)
{
	double sum0 = 0.0, sum1 = 0.0;

	sum0 += A[0] * B[1] * C[2] + A[1] * B[2] * C[0] + A[2] * B[0] * C[1];
	sum1 += A[1] * B[0] * C[2] + A[0] * B[2] * C[1] + A[2] * B[1] * C[0];
	return sum0 - sum1;
}

static void Exercises_Section_1_13_1_Triple_Products()
{
	// triple products (a)
	std::vector<double> A1 = { 2, 0, 0 };
	std::vector<double> B1 = { 0, 3, 0 };
	std::vector<double> C1 = { 0, 0, 5 };
	double tp_1 = TripleProduct(A1, B1, C1);
	std::cout << "Exercise 1 (a)" << '\t';
	std::cout << tp_1 << std::endl;
	// triple products (b)
	std::vector<double> A2 = { 1, 1, 1 };
	std::vector<double> B2 = { 3, 1, 0 };
	std::vector<double> C2 = { 0, -1, 5 };
	std::cout << "Exercise 1 (b)" << '\t';
	double tp_2 = TripleProduct(A2, B2, C2);
	std::cout << tp_2 << std::endl;
	// triple products (c)
	std::vector<double> A3 = { 2, -1, 1 };
	std::vector<double> B3 = { 1, 1, 1 };
	std::vector<double> C3 = { 2, 0, 3 };
	double tp_3 = TripleProduct(A3, B3, C3);
	std::cout << "Exercise 1 (c)" << '\t';
	std::cout << tp_3 << std::endl;
	// triple products (d)
	std::vector<double> A4 = { 0, 0, 1 };
	std::vector<double> B4 = { 1, 0, 0 };
	std::vector<double> C4 = { 0, 1, 0 };
	double tp_4 = TripleProduct(A4, B4, C4);
	std::cout << "Exercise 1 (d)" << '\t';
	std::cout << tp_4 << std::endl;
	// volume of a parallelpipped
	std::vector<double> A5 = { 3, 4, 1 };
	std::vector<double> B5 = { 2, 3, 4 };
	std::vector<double> C5 = { 0, 0, 5 }; 
	double tp_5 = TripleProduct(A5, B5, C5);
	std::cout << "Exercise 2" << '\t';
	std::cout << tp_5 << std::endl;
	// volume of a parallelpipped
	std::vector<double> A6 = { 3, 2, 1 };
	std::vector<double> B6 = { 4, 2, 1 };
	std::vector<double> C6 = { 0, 1, 4 };
	std::vector<double> D6 = { 0, 0, 7 };
	std::vector<double> AB = { -1, 0, 0 };
	std::vector<double> AC = { 3, 1, -3 };
	std::vector<double> AD = { 3, 2, -6 };
	std::cout << "Exercise 3" << '\t';
	double tp_6 = TripleProduct(AB, AC, AD);
	std::cout << tp_6 << std::endl;
	// volume of a tetrahedron
	std::vector<double> AB1 = { 1, 1, 0 };
	std::vector<double> AC1 = { 1, -1, 0 };
	std::vector<double> AD1 = { 0, 0, 2 };
	std::cout << "Exercise 4" << '\t';
	double tp_7 = TripleProduct(AB1, AC1, AD1) / 6.0;
	std::cout << fabs(tp_7) << std::endl;
	std::vector<double> P1 = { 0, 0, 0 };
	std::vector<double> P2 = { 1, 1, 0 };
	std::vector<double> P3 = { 3, 4, 0 };
	std::vector<double> P4 = { 4, 5, 0 };
	std::vector<double> P5 = { 0, 0, 1 };
	std::vector<double> Q1 = { 1, 1, 0 };
	std::vector<double> Q2 = { 2, 3, 0 };
	std::vector<double> Q3 = { 1, 1, 1 };
	std::cout << "Exercise 5" << '\t';
	double tp_8 = TripleProduct(Q1, Q2, Q3);
	std::cout << fabs(tp_8) << std::endl;
	std::vector<double> A10 = { 1, 1, 1 };
	std::vector<double> B10 = { 2, 4, -1 };
	std::vector<double> C10 = { 1, 1, 3 };
	double tp_10 = TripleProduct(A10, B10, C10);
	std::vector<double> D10 = { 0 };
	VectorProduct(A10, B10, D10);
	double magnitude = sqrt(InnerProduct(D10, D10, 3));
	std::cout << "Exercise 10" << '\t';
	std::cout << tp_10 / magnitude << '\t';
	std::cout << 2.0 * sqrt(38.0) / 19.0 << std::endl;
	std::vector<double> A11 = { 1, 1, 1 };
	std::vector<double> B11 = { 2, 4, -1 };
	std::vector<double> C11 = { 1, 1, 3 };
	std::vector<double> D11 = { 3, 2, 1 };
	std::vector<double> AB11(3), BC11(3), CA11(3), BCCA11(3);
	VectorProduct(A11, B11, AB11);
	VectorProduct(B11, C11, BC11);
	VectorProduct(C11, A11, CA11);
	VectorProduct(BC11, CA11, BCCA11);
	double Q11 = InnerProduct(AB11, BCCA11, 3);
	double A_x = A11[0], A_y = A11[1], A_z = A11[2];
	double B_x = B11[0], B_y = B11[1], B_z = B11[2];
	double C_x = C11[0], C_y = C11[1], C_z = C11[2];
	double term1 = +(A_y * B_z - A_z * B_y) * (B_z * C_x - B_x * C_z) * (C_x * A_y - C_y * A_x);
	double term2 = -(A_y * B_z - A_z * B_y) * (B_x * C_y - B_y * C_x) * (C_z * A_x - C_x * A_z);
	double term3 = +(A_z * B_x - A_x * B_z) * (B_x * C_y - B_y * C_x) * (C_y * A_z - C_z * A_y);
	double term4 = -(A_z * B_x - A_x * B_z) * (B_y * C_z - B_z * C_y) * (C_x * A_y - C_y * A_x);
	double term5 = +(A_x * B_y - A_y * B_x) * (B_y * C_z - B_z * C_y) * (C_z * A_x - C_x * A_z);
	double term6 = -(A_x * B_y - A_y * B_x) * (B_z * C_x - B_x * C_z) * (C_y * A_z - C_z * A_y);
	double P11 = term1 + term2 + term3 + term4 + term5 + term6;
	std::cout << "Q = (A x B) . (B x C) x (C x A) = " << Q11 << std::endl;
	std::cout << "P = (A x B) . (B x C) x (C x A) = " << P11 << std::endl;
}

static void Exercises_Section_1_14_Vector_Identities()
{
	std::vector<double> A11 = { 1, 1, 1 };
	std::vector<double> B11 = { 2, 4, -1 };
	std::vector<double> C11 = { 1, 1, 3 };
	std::vector<double> D11 = { 3, 2, 1 };
	std::cout << "Section 1.14 page 50 Exercises Exercise 1" << std::endl;
	std::cout << "A = " << A11[0] << '\t' << A11[1] << '\t' << A11[2] << std::endl;
	std::cout << "B = " << B11[0] << '\t' << B11[1] << '\t' << B11[2] << std::endl;
	std::cout << "C = " << C11[0] << '\t' << C11[1] << '\t' << C11[2] << std::endl;
	std::cout << "D = " << D11[0] << '\t' << D11[1] << '\t' << D11[2] << std::endl;
	std::cout << "TPI1 = (A x B) x (C x D) = [A, B, D]C - [A, B, C]D = " << std::endl;
	double TP1411a = TripleProduct(A11, B11, D11);
	double TP1411b = TripleProduct(A11, B11, C11);
	std::cout << "[A, B, D] = " << TP1411a << std::endl;
	std::cout << "[A, B, C] = " << TP1411b << std::endl;
	std::cout << "TPI1_x = " << TP1411a * C11[0] << std::endl;
	std::cout << "TPI1_y = " << TP1411a * C11[1] << std::endl;
	std::cout << "TPI1_z = " << TP1411a * C11[2] << std::endl;
	std::cout << "TPI2_x = " << TP1411b * D11[0] << std::endl;
	std::cout << "TPI2_y = " << TP1411b * D11[1] << std::endl;
	std::cout << "TPI2_z = " << TP1411b * D11[2] << std::endl;
	std::cout << "RHS1 = [A, B, D]C - [A, B, C]D = " << std::endl;
	std::vector<double> RHS1(3);
	RHS1[0] = TP1411a * C11[0] - TP1411b * D11[0];
	RHS1[1] = TP1411a * C11[1] - TP1411b * D11[1];
	RHS1[2] = TP1411a * C11[2] - TP1411b * D11[2];
	std::cout << "RHS1_x = " << RHS1[0] << std::endl;
	std::cout << "RHS1_y = " << RHS1[1] << std::endl;
	std::cout << "RHS1_z = " << RHS1[2] << std::endl;
	std::vector<double> CD11(3), TD11(3);
	std::vector<double> AB11(3), BC11(3), CA11(3), BCCA11(3);
	VectorProduct(A11, B11, AB11);
	VectorProduct(B11, C11, BC11);
	VectorProduct(C11, A11, CA11);
	VectorProduct(BC11, CA11, BCCA11);
	VectorProduct(A11, B11, AB11);
	VectorProduct(C11, D11, CD11);
	VectorProduct(AB11, CD11, TD11);
	std::cout << "A = " << A11[0] << '\t' << A11[1] << '\t' << A11[2] << std::endl;
	std::cout << "B = " << B11[0] << '\t' << B11[1] << '\t' << B11[2] << std::endl;
	std::cout << "C = " << C11[0] << '\t' << C11[1] << '\t' << C11[2] << std::endl;
	std::cout << "D = " << D11[0] << '\t' << D11[1] << '\t' << D11[2] << std::endl;
	std::cout << "A x B = " << AB11[0] << '\t' << AB11[1] << '\t' << AB11[2] << std::endl;
	std::cout << "C x D = " << CD11[0] << '\t' << CD11[1] << '\t' << CD11[2] << std::endl;
	std::cout << "TD11 = (A x B) x (C x D) = " << std::endl;
	std::cout << "TD11_x = " << TD11[0] << std::endl;
	std::cout << "TD11_y = " << TD11[1] << std::endl;
	std::cout << "TD11_z = " << TD11[2] << std::endl;
	VectorProduct(B11, C11, BC11);
	VectorProduct(C11, A11, CA11);
	VectorProduct(BC11, CA11, D11);
	VectorProduct(A11, B11, AB11);
	double ip12 = InnerProduct(AB11, D11, 3);
	std::cout << "2. Inner Product = " << ip12 << std::endl;
	double tp12 = TripleProduct(A11, B11, C11);
	std::cout << "2. Triple Product ^ 2 = " << tp12 * tp12 << std::endl;
	std::vector<double> ABC11(3), BAC11(3), CAB11(3);
	VectorProduct(A11, BC11, ABC11);
	VectorProduct(B11, CA11, BAC11);
	VectorProduct(C11, AB11, CAB11);
	double zx = ABC11[0] + BAC11[0] + CAB11[0];
	double zy = ABC11[1] + BAC11[1] + CAB11[1];
	double zz = ABC11[2] + BAC11[2] + CAB11[2];
	std::cout << "3. Zero Vector = " << zx << ' ' << zy << ' ' << zz;
	std::cout << std::endl;
}

int main()
{
	Exercises_Section_1_13_1_Triple_Products();
	Exercises_Section_1_14_Vector_Identities();
	return 0;
}

Blog Entry © Tuesday, April 14, 2026, by James Pate Williams, Jr. Exercises and Supplementary Problems from Introduction to Vector Analysis Fourth Edition © 1979 by Harry F. Davis and Arthur David Snider Selected Exercises from Chapter 1 Page 48

// VectorAnalysis.cpp © Tuesday, April 14, 2026
// by James Pate Williams, Jr.
// Reference: Introduction to Vector Analysis Fourth Edition
// © 1979 by Harry F. Davis and Arthur David Snider 

#include <iostream>
#include <vector>

static double InnerProduct(
	std::vector<double> A,
	std::vector<double> B,
	int n)
{
	double sum = 0.0;

	for (int i = 0; i < n; i++)
		sum += A[i] * B[i];

	return sum;
}

static void VectorProduct(
	std::vector<double> A,
	std::vector<double> B,
	std::vector<double>&C)
{
	C.resize(3);
	C[0] = A[1] * B[2] - A[2] * B[1];
	C[1] = A[0] * B[2] - A[2] * B[0];
	C[2] = A[0] * B[1] - A[1] * B[0];
}

static double TripleProduct(
	std::vector<double> A,
	std::vector<double> B,
	std::vector<double> C)
{
	double sum0 = 0.0, sum1 = 0.0;

	sum0 += A[0] * B[1] * C[2] + A[1] * B[2] * C[0] + A[2] * B[0] * C[1];
	sum1 += A[1] * B[0] * C[2] + A[0] * B[2] * C[1] + A[2] * B[1] * C[0];
	return sum0 - sum1;
}

static void Exercises_Section_1_13_1_Triple_Products()
{
	// triple products (a)
	std::vector<double> A1 = { 2, 0, 0 };
	std::vector<double> B1 = { 0, 3, 0 };
	std::vector<double> C1 = { 0, 0, 5 };
	double tp_1 = TripleProduct(A1, B1, C1);
	std::cout << "Exercise 1 (a)" << '\t';
	std::cout << tp_1 << std::endl;
	// triple products (b)
	std::vector<double> A2 = { 1, 1, 1 };
	std::vector<double> B2 = { 3, 1, 0 };
	std::vector<double> C2 = { 0, -1, 5 };
	std::cout << "Exercise 1 (b)" << '\t';
	double tp_2 = TripleProduct(A2, B2, C2);
	std::cout << tp_2 << std::endl;
	// triple products (c)
	std::vector<double> A3 = { 2, -1, 1 };
	std::vector<double> B3 = { 1, 1, 1 };
	std::vector<double> C3 = { 2, 0, 3 };
	double tp_3 = TripleProduct(A3, B3, C3);
	std::cout << "Exercise 1 (c)" << '\t';
	std::cout << tp_3 << std::endl;
	// triple products (d)
	std::vector<double> A4 = { 0, 0, 1 };
	std::vector<double> B4 = { 1, 0, 0 };
	std::vector<double> C4 = { 0, 1, 0 };
	double tp_4 = TripleProduct(A4, B4, C4);
	std::cout << "Exercise 1 (d)" << '\t';
	std::cout << tp_4 << std::endl;
	// volume of a parallelpipped
	std::vector<double> A5 = { 3, 4, 1 };
	std::vector<double> B5 = { 2, 3, 4 };
	std::vector<double> C5 = { 0, 0, 5 }; 
	double tp_5 = TripleProduct(A5, B5, C5);
	std::cout << "Exercise 2" << '\t';
	std::cout << tp_5 << std::endl;
	// volume of a parallelpipped
	std::vector<double> A6 = { 3, 2, 1 };
	std::vector<double> B6 = { 4, 2, 1 };
	std::vector<double> C6 = { 0, 1, 4 };
	std::vector<double> D6 = { 0, 0, 7 };
	std::vector<double> AB = { -1, 0, 0 };
	std::vector<double> AC = { 3, 1, -3 };
	std::vector<double> AD = { 3, 2, -6 };
	std::cout << "Exercise 3" << '\t';
	double tp_6 = TripleProduct(AB, AC, AD);
	std::cout << tp_6 << std::endl;
	// volume of a tetrahedron
	std::vector<double> AB1 = { 1, 1, 0 };
	std::vector<double> AC1 = { 1, -1, 0 };
	std::vector<double> AD1 = { 0, 0, 2 };
	std::cout << "Exercise 4" << '\t';
	double tp_7 = TripleProduct(AB1, AC1, AD1) / 6.0;
	std::cout << fabs(tp_7) << std::endl;
	std::vector<double> P1 = { 0, 0, 0 };
	std::vector<double> P2 = { 1, 1, 0 };
	std::vector<double> P3 = { 3, 4, 0 };
	std::vector<double> P4 = { 4, 5, 0 };
	std::vector<double> P5 = { 0, 0, 1 };
	std::vector<double> Q1 = { 1, 1, 0 };
	std::vector<double> Q2 = { 2, 3, 0 };
	std::vector<double> Q3 = { 1, 1, 1 };
	std::cout << "Exercise 5" << '\t';
	double tp_8 = TripleProduct(Q1, Q2, Q3);
	std::cout << fabs(tp_8) << std::endl;
	std::vector<double> A10 = { 1, 1, 1 };
	std::vector<double> B10 = { 2, 4, -1 };
	std::vector<double> C10 = { 1, 1, 3 };
	double tp_10 = TripleProduct(A10, B10, C10);
	std::vector<double> D10 = { 0 };
	VectorProduct(A10, B10, D10);
	double magnitude = sqrt(InnerProduct(D10, D10, 3));
	std::cout << "Exercise 10" << '\t';
	std::cout << tp_10 / magnitude << '\t';
	std::cout << 2.0 * sqrt(38.0) / 19.0 << std::endl;
}

int main()
{
	Exercises_Section_1_13_1_Triple_Products();
	return 0;
}

Blog Entry © Tuesday, April 7, 2026, by James Pate Williams, Jr., Hydrogen-like Atom Polar and Azimuthal Wavefunctions