SHARE
TWEET

Untitled

a guest Nov 22nd, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  public static bool IsVectorInSegment(Vector vector, Segment segment)
  2.         {
  3.             var segmentLength = GetLength(segment);
  4.             var beginLength = GetLength(new Vector {X = vector.X - segment.Begin.X, Y = vector.Y - segment.Begin.Y });
  5.             var endlength = GetLength(new Vector { X = vector.X - segment.End.X, Y = vector.Y - segment.End.Y });
  6.  
  7.             return ((beginLength + endlength) - segmentLength) < 0.00000000000001;
  8.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top