MathHelper.Distance Method (Microsoft.Xna.Framework)

Calculates the absolute value of the difference of two values.

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

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.


Type: System.Single
Source value.
Type: System.Single
Source value.

Return Value

Type: System.Single
Distance between the two values.
Supported in:

 Windows DirectX Desktop
 Linux Desktop
 Windows OpenGL Desktop