// Returns the maximum error in the result of UpdateMinDistance (and // associated functions such as UpdateMinInteriorDistance, IsDistanceLess, // etc), assuming that all input points are normalized to within the bounds // guaranteed by S2Point.Normalize(). The error can be added or subtracted // from an S1ChordAngle "x" using x.PlusError(error). // // Note that accuracy goes down as the distance approaches 0 degrees or 180 // degrees (for different reasons). Near 0 degrees the error is acceptable // for all practical purposes (about 1.2e-15 radians ~= 8 nanometers). For // exactly antipodal points the maximum error is quite high (0.5 meters), but // this error drops rapidly as the points move away from antipodality // (approximately 1 millimeter for points that are 50 meters from antipodal, // and 1 micrometer for points that are 50km from antipodal). public static double GetUpdateMinDistanceMaxError(S1ChordAngle dist) { // There are two cases for the maximum error in UpdateMinDistance(), // depending on whether the closest point is interior to the edge. return(Math.Max(GetUpdateMinInteriorDistanceMaxError(dist), dist.GetS2PointConstructorMaxError())); }