Question: Define a function, temperature _ at _ nearest _ edge ( x , y , length, edge, cnr _ temps ) , which returns the
Define a function, temperatureatnearestedgex y length, edge, cnrtemps which returns the temperature that is closest to point xy near edge. The edge parameter is an integer South; East; North; West The temperatures at the corners of the square are supplied as a dictionary with keys as the compass points: swsene and nw and the values are the temperatures at those corners. For example: cnrtemps swsenenw The temperature at the nearest point on the edge will need to be linearly interpolated for example if the nearest point is at x on the edge. This means we need to interpolate the temperature value from the known values at the southwest corner K and the southeast corner K We can compute the fractional distance along the edge, f with f
and then use that to weight the contribution from each corner. This gives us a linear interpolation of the value:
Tedge f X TSW f X TSE
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
