```python
import numpy as np
from matplotlib import pyplot
```


```python
from sympy import sin, cos, Matrix, sqrt, simplify, solve
from sympy.abc import rho, phi, x, y, z, X, Y, Z, R
```


```python
def normalized(x,y,z):
    v = np.array((x,y,z))
    return v / np.linalg.norm(v)
```


```python
# default Stereographics projection
R = sqrt(X*X + Y*Y)
x_ = 2*X/(1 + R*R)
y_ = 2*Y/(1 + R*R)
z_ = (-1+R*R)/(1 + R*R)
```


```python
Finv = Matrix([x_, y_, z_])
Finv
```


```python
# compute jacobian determinant for integral transformation / transformation of probability density
# https://en.wikipedia.org/wiki/Stereographic_projection
J = Finv.jacobian(Matrix([X,Y]))
J
```


```python
fu = sqrt(simplify(simplify((J.T*J).det())))
fu
```


```python
def distortion(r):
    return simplify(fu.subs({X : 0, Y : r})).evalf()
```


```python
distortion(1.)
```


```python

```

d3d16d60709169aeab86d6301f87ee370c72c77b
ipynb
Jupyter Notebook
misc/Stereoprojection1.ipynb
DaWelter/NaiveTrace
a904785a0e13c394b2c221bc918cddb41bc8b175
FSFAP
2018-04-25T08:14:14.000Z
2022-01-29T06:19:16.000Z
misc/Stereoprojection1.ipynb
DaWelter/NaiveTrace
a904785a0e13c394b2c221bc918cddb41bc8b175
FSFAP
misc/Stereoprojection1.ipynb
DaWelter/NaiveTrace
a904785a0e13c394b2c221bc918cddb41bc8b175
FSFAP
Qwen/Qwen-72B
1. YES
2. YES