本文整理汇总了C#中System.Windows.Vector.ToVector3D方法的典型用法代码示例。如果您正苦于以下问题:C# Vector.ToVector3D方法的具体用法?C# Vector.ToVector3D怎么用?C# Vector.ToVector3D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Vector
的用法示例。
在下文中一共展示了Vector.ToVector3D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RandomBellArgs
/// <summary>
/// Play with the NonlinearRandom tester to come up with values
/// </summary>
public RandomBellArgs(double leftArmLength, double leftArmAngle, double rightArmLength, double rightArmAngle)
{
List<Point3D> controlPoints = new List<Point3D>();
// Arm1
if (!leftArmLength.IsNearZero())
{
Vector arm1 = new Vector(1, 1).ToUnit() * leftArmLength;
controlPoints.Add(arm1.ToVector3D().GetRotatedVector(new Vector3D(0, 0, -1), leftArmAngle).ToPoint());
}
// Arm2
if (!rightArmLength.IsNearZero())
{
Vector arm2 = new Vector(-1, -1).ToUnit() * rightArmLength;
Vector3D arm2Rotated = arm2.
ToVector3D().
GetRotatedVector(new Vector3D(0, 0, -1), rightArmAngle);
controlPoints.Add(new Point3D(1 + arm2Rotated.X, 1 + arm2Rotated.Y, 0));
}
// Bezier
this.Bezier = new BezierSegment3D(0, 1, controlPoints.ToArray(), new[] { new Point3D(0, 0, 0), new Point3D(1, 1, 0) });
}