本文整理汇总了C#中Point.ToVector方法的典型用法代码示例。如果您正苦于以下问题:C# Point.ToVector方法的具体用法?C# Point.ToVector怎么用?C# Point.ToVector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point.ToVector方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IrregularCell
public IrregularCell(Point lb, Point rb, Point rt, Point lt)
{
leftTop = lt.ToVector();
leftBottom = lb.ToVector();
rightTop = rt.ToVector();
rightBottom = rb.ToVector();
}
示例2: CalculateMovement
private Vector2 CalculateMovement(Point current, float amount)
{
Vector2 result = new Vector2();
Vector2 cVector = current.ToVector();
Vector2 dVector = destination.ToVector();
Vector2.SmoothStep(ref cVector, ref dVector, amount, out result);
return result;
}
示例3: GetClippingPoint
public static Point GetClippingPoint(Size size, Point s, Point t)
{
double[] sides = new double[4];
sides[0] = (s.X - size.Width / 2.0 - t.X) / (s.X - t.X);
sides[1] = (s.Y - size.Height / 2.0 - t.Y) / (s.Y - t.Y);
sides[2] = (s.X + size.Width / 2.0 - t.X) / (s.X - t.X);
sides[3] = (s.Y + size.Height / 2.0 - t.Y) / (s.Y - t.Y);
double fi = 0;
for (int i = 0; i < 4; i++)
{
if (sides[i] <= 1)
fi = Math.Max(fi, sides[i]);
}
if (fi == 0)
{
fi = double.PositiveInfinity;
for (int i = 0; i < 4; i++)
fi = Math.Min(fi, Math.Abs(sides[i]));
fi *= -1;
}
return t + fi * (s.ToVector() - t);
}