code: def get_ry0_distance(self, mesh):
          
          # If the GC2 calculations have already been computed (by invoking Ry0
          # first) and the mesh is identical then class has GC2 attributes
          # already pre-calculated
          if not self.tmp_mesh or (self.tmp_mesh == mesh):
              # If that's not the case, or the mesh is different then
              # re-compute GC2 configuration
              self.gc2t, self.gc2u = self.get_generalised_coordinates(mesh.lons,
                                                                      mesh.lats)
              # Update mesh
              self.tmp_mesh = deepcopy(mesh)
  
          # Default value ry0 (for sites within fault length) is 0.0
          ry0 = numpy.zeros_like(self.gc2u, dtype=float)
  
          # For sites with negative gc2u (off the initial point of the fault)
          # take the absolute value of gc2u
          neg_gc2u = self.gc2u < 0.0
          ry0[neg_gc2u] = numpy.fabs(self.gc2u[neg_gc2u])
  
          # Sites off the end of the fault have values shifted by the
          # GC2 length of the fault
          pos_gc2u = self.gc2u >= self.gc_length
          ry0[pos_gc2u] = self.gc2u[pos_gc2u] - self.gc_length
          return ry0
docs: For each point determine the corresponding Ry0 distance using the GC2
          configuration.
  
          See :meth:`superclass method
          <.base.BaseSurface.get_ry0_distance>`
          for spec of input and result values.