共用方式為


MathHelper.Distance Method

Calculates the absolute value of the difference of two values.

Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public static float Distance (
         float value1,
         float value2
)

Parameters

  • value1
    Source value.
  • value2
    Source value.

Return Value

Distance between the two values.

See Also

Reference

MathHelper Class
MathHelper Members
Microsoft.Xna.Framework Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista