// Faster than the function above due to the use of S1ChordAngle. public static S2Point GetPointToRight(S2Point a, S2Point b, S1ChordAngle r) { return(GetPointOnRay(a, S2.RobustCrossProd(b, a).Normalize(), r)); }
// Returns true if the minimum distance from X to the edge AB is attained at // an interior point of AB (i.e., not an endpoint), and that distance is less // than "limit". (Specify limit.Successor() for "less than or equal to".) public static bool IsInteriorDistanceLess(S2Point x, S2Point a, S2Point b, S1ChordAngle limit) { return(UpdateMinInteriorDistance(x, a, b, ref limit)); }
// If the minimum distance from X to AB is attained at an interior point of AB // (i.e., not an endpoint), and that distance is less than "min_dist", then // this method updates "min_dist" and returns true. Otherwise returns false. public static bool UpdateMinInteriorDistance(S2Point x, S2Point a, S2Point b, ref S1ChordAngle min_dist) { double xa2 = (x - a).Norm2(), xb2 = (x - b).Norm2(); return(AlwaysUpdateMinInteriorDistance(x, a, b, xa2, xb2, ref min_dist, false)); }
public void Test_S1ChordAngle_Negative() { Assert.True(S1ChordAngle.Negative < S1ChordAngle.Zero); Assert.True(S1ChordAngle.Negative == S1ChordAngle.FromLength2(-1)); Assert.True(S1ChordAngle.Negative.ToAngle() < S1Angle.Zero); }