Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static float LineDistance( Vector2 beginningPosition, Vector2 endingPosition )
- {
- float x = endingPosition.x - beginningPosition.x;
- x = x * x;
- float y = endingPosition.y - beginningPosition.y;
- y = y * y;
- float result = Mathf.Sqrt( x + y );
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement