{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "4d72f0ee",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "d21b692b",
            "cell_type": "markdown",
            "source": "Basic homogeneity property:\n",
            "metadata": {}
        },
        {
            "id": "058d9b06",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.special import elliprg",
            "outputs": []
        },
        {
            "id": "3094ff36",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "x = 1.2 + 3.4j\ny = 5.\nz = 6.\nscale = 0.3 + 0.4j\nelliprg(scale*x, scale*y, scale*z)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(1.195936862005246+0.8470988320464167j)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "390c21b3",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "elliprg(x, y, z)*np.sqrt(scale)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(1.195936862005246+0.8470988320464165j)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "90b28edd",
            "cell_type": "markdown",
            "source": "Simplifications:\n",
            "metadata": {}
        },
        {
            "id": "75c4fdc6",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "elliprg(0, y, y)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.756203682760182"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "8b662ded",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "0.25*np.pi*np.sqrt(y)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.7562036827601817"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d4684df0",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "elliprg(0, 0, z)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.224744871391589"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "28ee6a13",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "0.5*np.sqrt(z)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.224744871391589"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "da38bfba",
            "cell_type": "markdown",
            "source": "The surface area of a triaxial ellipsoid with semiaxes ``a``, ``b``, and\n``c`` is given by\n\n$$ S = 4 \\pi a b c R_{\\mathrm{G}}(1 / a^2, 1 / b^2, 1 / c^2). $$",
            "metadata": {}
        },
        {
            "id": "4f0285b8",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "def ellipsoid_area(a, b, c):\n    r = 4.0 * np.pi * a * b * c\n    return r * elliprg(1.0 / (a * a), 1.0 / (b * b), 1.0 / (c * c))\nprint(ellipsoid_area(1, 3, 5))",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "108.62688289491807"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}