GrapherApp.UI/Model/Vector2.cs
/// <summary>
///   <para>Moves a point current towards target.</para>
/// </summary>
/// <param name="current"></param>
/// <param name="target"></param>
/// <param name="maxDistanceDelta"></param>
Moves a point current towards target.
Moves a point current towards target .
public static Vector2 MoveTowards(Vector2 current, Vector2 target, float maxDistanceDelta)
		{
			Vector2 a = target - current;
			float magnitude = a.magnitude;
			if (magnitude <= maxDistanceDelta || magnitude == 0f)
			{
				return target;
			}
			return current + a / magnitude * maxDistanceDelta;
		}
public static Vector2 MoveTowards ( Vector2 current , Vector2 target , float maxDistanceDelta ) { Vector2 a = target - current ; float magnitude = a . magnitude ; if ( magnitude <= maxDistanceDelta || magnitude == 0f ) { return target ; } return current + a / magnitude * maxDistanceDelta ; }
Moves a point current towards target.
Moves a point current towards target .
current
Vector2
None
target
Vector2
None
maxDistanceDelta
float
None