Exercise

Storing data in a dictionary

The surface you see below is called circular paraboloid:

Circular Paraboloid

It can be described by the following equation: $$ \frac{x^2}{a^2} + \frac{y^2}{a^2} = z $$ Let's set the coefficient \(a\) to 1. Therefore, the radius at each cut will be equal to \(\sqrt{z}\).

Your task is to create a dictionary that stores the mapping from the pair of coordinates \((x, y)\) to the \(z\) coordinate (the lists storing considered ranges for \(x\) and \(y\) are given: range_x and range_y, respectively).

Instructions 1/3

undefined XP
    1
    2
    3
  • Calculate the value for \(z\) coordinate using coordinates \(x\) and \(y\).
  • Create a new key for the dictionary circ_parab represented as a tuple containing \(x\) and \(y\).
  • Create a new key-value pair for circ_parab.