Question: Define a function, temperature _ at _ nearest _ edge ( x , y , length, edge, cnr _ temps ) , which returns the

Define a function, temperature_at_nearest_edge(x, y, length, edge, cnr_temps), which returns the temperature that is closest to point (x,y) near edge. The edge parameter is an integer (0, South; 1, East; 2, North; 3, West). The temperatures at the corners of the square are supplied as a dictionary with keys as the compass points: sw,se,ne and nw, and the values are the temperatures at those corners. For example: cnr_temps ={'sw'=600.0,'se'=700.0,'ne'=1000.0,'nw'=850.0}. The temperature at the nearest point on the edge will need to be linearly interpolated , for example if the nearest point is at x =0.6 on the [0] edge. This means we need to interpolate the temperature value from the known values at the south-west corner (600.0 K) and the south-east corner (700.0 K). We can compute the fractional distance along the edge, f (with 0<= f <=1),
and then use that to weight the contribution from each corner. This gives us a linear interpolation of the value:
Tedge =(1 f) X TSW + f X TSE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!