本文整理汇总了C#中System.Windows.Vector.Perpendicular方法的典型用法代码示例。如果您正苦于以下问题:C# Vector.Perpendicular方法的具体用法?C# Vector.Perpendicular怎么用?C# Vector.Perpendicular使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Vector
的用法示例。
在下文中一共展示了Vector.Perpendicular方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTriangle
private Triangle CreateTriangle(Point position, Vector direction)
{
direction.Normalize();
direction *= vectorLength;
Point p1 = position + 1.7 / 3 * direction;
Point basePoint = position - 0.3333333 * direction;
var perpendicular = direction.Perpendicular();
perpendicular.Normalize();
perpendicular *= 0.166666666666;
Point p2 = basePoint + perpendicular;
Point p3 = basePoint - perpendicular;
Triangle triangle = trianglesPool.GetOrCreate();
triangle.Point1 = new Point3D(p1.X, p1.Y, 0);
triangle.Point2 = new Point3D(p2.X, p2.Y, 0);
triangle.Point3 = new Point3D(p3.X, p3.Y, 0);
return triangle;
}