Vector2.Distance Method (Vector2, Vector2)

Calculates the distance between two vectors.

Namespace:  Microsoft.Xna.Framework
Assembly:  Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)

public static float Distance(
	Vector2 value1,
	Vector2 value2
)

Parameters

value1
Type: Microsoft.Xna.Framework.Vector2
Source vector.
value2
Type: Microsoft.Xna.Framework.Vector2
Source vector.

Return Value

Type: System.Single
Distance between the two vectors.

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: