Vector2.Distance Method (Microsoft.Xna.Framework)

Returns the distance between two vectors.

Namespace: Microsoft.Xna.Framework
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.398)
  • C#
  • VB
  • F#
public static float Distance(
	Vector2 value1, 
	Vector2 value2
)

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

Parameters

value1
Type: Microsoft.Xna.Framework.Vector2
The first vector.
value2
Type: Microsoft.Xna.Framework.Vector2
The second vector.

Return Value

Type: System.Single
The distance between two vectors.
Supported in:

    
 Windows DirectX Desktop
    
 Linux Desktop
    
 Windows OpenGL Desktop
    
 Web