Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public static float LineDistance( Vector2 beginningPosition, Vector2 endingPosition )
  2. {
  3. float x = endingPosition.x - beginningPosition.x;
  4. x = x * x;
  5.  
  6. float y = endingPosition.y - beginningPosition.y;
  7. y = y * y;
  8.  
  9. float result = Mathf.Sqrt( x + y );
  10.  
  11. return result;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement