本文整理汇总了C#中System.Windows.Vector.Angle方法的典型用法代码示例。如果您正苦于以下问题:C# Vector.Angle方法的具体用法?C# Vector.Angle怎么用?C# Vector.Angle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Vector
的用法示例。
在下文中一共展示了Vector.Angle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tangent
public static Vector Tangent(this Vector v, Vector v1, Vector v2)
{
double a1 = v1.Angle();
double a2 = v2.Angle();
v = new Vector(v.Length, 0).Rotate(a1 + (a2 - a1) / 2);
// double a = v.Angle();
Vector v1b = v1 - v;
Vector v2b = v2 - v;
double a1b = Vector.AngleBetween(v1b, v);
double a2b = Vector.AngleBetween(v, v2b);
int i = 0;
while (Math.Round(a1b, 10) != Math.Round(a2b, 10))
{
if (a2b > a1b)
{
a1 = v.Angle();
}
else if (a1b > a2b)
{
a2 = v.Angle();
}
v = new Vector(v.Length, 0).Rotate(a1 + (a2 - a1) / 2);
a1b = Vector.AngleBetween(v1b, v);
a2b = Vector.AngleBetween(v, v2b);
// a = v.Angle();
// Console.WriteLine("{0} {1} {2}", a1b, a2b, a);
i++;
}
return v;
}
示例2: TestThreeLine
public void TestThreeLine()
{
Vector v = new Vector(3, 0).Tangent(new Vector(10, 0), new Vector(0, 10));
Dictionary<int, double> d = new Dictionary<int, double>();
for (int i = 5; i < 100; i++)
{
v = new Vector(5, 0).Tangent(new Vector(10, 0), new Vector(0, i));
double a = v.Angle();
d.Add(i, a);
}
}
示例3: getFishAngle
private double getFishAngle(Microsoft.Kinect.JointCollection joints)
{
Point a = getDisplayPosition(joints[JointType.Head]);
a = getDisplayPosition(joints[JointType.ShoulderCenter]);
Point b = getDisplayPosition(joints[JointType.Spine]);
//Point c = new Point(a.X, b.Y + (b.Y-a.Y));
//Point c = Average(
//getDisplayPosition(joints[Joint.AnkleLeft]),
//getDisplayPosition(joints[Joint.AnkleRight]));
//System.Windows.Vector v1 = new System.Windows.Vector(c.X-b.X,c.Y - b.Y);
System.Windows.Vector v2 = new System.Windows.Vector(b.X - a.X, b.Y - a.Y);
double ang = AngleConstrain(2*(v2.Angle() - 90.0), -30, 30);//AngleConstrain(-NormalizeAngle(180.0 - v2.Angle()), -30, 30);
//Console.WriteLine(ang);
return ang;
}