First page Back Continue Last page Overview Graphics

Calculation of the Values

import numpy as np

xlist = np.linspace(-3.0, 3.0, 3)

ylist = np.linspace(-3.0, 3.0, 4)

X, Y = np.meshgrid(xlist, ylist)

Z = np.sqrt(X**2 + Y**2)

print(Z)

[[ 4.24264069 3. 4.24264069]

[ 3.16227766 1. 3.16227766]

[ 3.16227766 1. 3.16227766]

[ 4.24264069 3. 4.24264069]]