本文整理汇总了C#中System.Windows.Point.Subtract方法的典型用法代码示例。如果您正苦于以下问题:C# Point.Subtract方法的具体用法?C# Point.Subtract怎么用?C# Point.Subtract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Point
的用法示例。
在下文中一共展示了Point.Subtract方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AngleRad
public static double AngleRad(Point point1, Point point2, Point point3)
{
double rad = AngleRad(point2.Subtract(point1), point2.Subtract(point3));
double rad2 = AngleRad(point2.Subtract(point1), (point2.Subtract(point3)).RightAngle());
if (rad2 < (Math.PI / 2))
{
return rad;
}
else
{
return (Math.PI * 2) - rad;
}
}
示例2: Animate
public static bool Animate(
Point currentValue, Vector currentVelocity, Point targetValue,
double attractionFator, double dampening,
double terminalVelocity, double minValueDelta, double minVelocityDelta,
out Point newValue, out Vector newVelocity)
{
Vector diff = targetValue.Subtract(currentValue);
if (diff.Length > minValueDelta || currentVelocity.Length > minVelocityDelta)
{
newVelocity = currentVelocity * (1 - dampening);
newVelocity += diff * attractionFator;
if (currentVelocity.Length > terminalVelocity)
{
newVelocity *= terminalVelocity / currentVelocity.Length;
}
newValue = currentValue + newVelocity;
return true;
}
else
{
newValue = targetValue;
newVelocity = new Vector();
return false;
}
}
示例3: IsMovedALot
public static bool IsMovedALot(Point originLocation, Point newLocation, out Point dif)
{
dif = originLocation.Subtract(newLocation);
if (dif.X > 400 || dif.X < -400 || dif.Y > 400 || dif.Y < -400)
{
return true;
}
return false;
}