Beispiel #1
0
 // 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));
 }
Beispiel #2
0
 // 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));
 }
Beispiel #3
0
    // 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));
    }
Beispiel #4
0
 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);
 }