本文整理汇总了C#中Vector3D.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3D.ToString方法的具体用法?C# Vector3D.ToString怎么用?C# Vector3D.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3D
的用法示例。
在下文中一共展示了Vector3D.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: boneNormalOffset
/// <summary>
/// Takes 2 joints, A & B, and returns the of angle between ray(AB) and
/// the ground's normal vector (Assuming Kinect is level).
/// A\ |
/// \ |
/// B\ |
/// \x|
/// Ground _ _ _ \|_ _ _ Ground
///
/// Example Usage:
/// The following returns the extension angle of skel's right elbow...
/// jointAngle(skel.Joints[JointType.ShoulderRight],
/// skel.Joints[JointType.ElbowRight],
/// skel.Joints[JointType.WristRight])
/// </summary>
public static float boneNormalOffset(Joint a, Joint b)
{
Vector3D va = new Vector3D(a.Position.X, a.Position.Y, a.Position.Z);
Vector3D vb = new Vector3D(b.Position.X, b.Position.Y, b.Position.Z);
Vector3D vn = new Vector3D(b.Position.X, b.Position.Y + 0.5, b.Position.Z);
Vector3D vba = new Vector3D();
vba = Vector3D.Subtract(va, vb);
Vector3D vbn = new Vector3D();
vbn = Vector3D.Subtract(vn, vb);
if (debug)
{
Console.Out.WriteLine("va: " + va.ToString());
Console.Out.WriteLine("vb: " + vb.ToString());
Console.Out.WriteLine("vn: " + vn.ToString());
Console.Out.WriteLine("vba: " + vba.ToString());
Console.Out.WriteLine("vbn: " + vbn.ToString());
Console.Out.WriteLine("NormalOffset(vba,vbn): " + Vector3D.AngleBetween(vba, vbn));
}
return (float)Vector3D.AngleBetween(vba, vbn);
}
示例2: ToStringAndFromString
public void ToStringAndFromString()
{
var v = new Vector3D(2.23f, 3.45f, 0.59f);
string vectorAsString = v.ToString();
Assert.AreEqual(v, new Vector3D(vectorAsString));
}
示例3: jointDistanceZAxis
/// <summary>
/// Takes 2 joints, A & B, and returns the Distance(A<->B) as a float.
///
/// Example Usage:
/// The following returns the distance traveled between to frames:
/// jointDistance(skel_before.Joints[JointType.ShoulderCenter],
/// skel_after.Joints[JointType.ShoulderCenter])
///
/// The following returns the distance between two wrists in one frame:
/// jointDistance(skel.Joints[JointType.WristRight],
/// skel.Joints[JointType.WristLeft]);
/// </summary>
public static float jointDistanceZAxis(Joint a, Joint b)
{
Vector3D va = new Vector3D(0, 0, a.Position.Z);
Vector3D vb = new Vector3D(0, 0, b.Position.Z);
Vector3D vba = new Vector3D();
vba = Vector3D.Subtract(va, vb);
if (debug)
{
Console.Out.WriteLine("va: " + va.ToString());
Console.Out.WriteLine("vb: " + vb.ToString());
Console.Out.WriteLine("vba: " + vba.ToString());
Console.Out.WriteLine("Distance(vba,vbc): " + vba.Length);
}
return (float)vba.Length;
}
示例4: jointAngle
/// <summary>
/// Takes 3 joints, A, B, & C, and returns the Angle(ABC) as a float.
/// A
/// /
/// /
/// /B_ _ _C
///
/// Example Usage:
/// The following returns the extension angle of skel's right elbow...
/// jointAngle(skel.Joints[JointType.ShoulderRight],
/// skel.Joints[JointType.ElbowRight],
/// skel.Joints[JointType.WristRight])
/// </summary>
public static float jointAngle(Joint a, Joint b, Joint c)
{
Vector3D va = new Vector3D(a.Position.X, a.Position.Y, a.Position.Z);
Vector3D vb = new Vector3D(b.Position.X, b.Position.Y, b.Position.Z);
Vector3D vc = new Vector3D(c.Position.X, c.Position.Y, c.Position.Z);
Vector3D vba = new Vector3D();
vba = Vector3D.Subtract(va, vb);
Vector3D vbc = new Vector3D();
vbc = Vector3D.Subtract(vc, vb);
if (debug)
{
Console.Out.WriteLine("va: " + va.ToString());
Console.Out.WriteLine("vb: " + vb.ToString());
Console.Out.WriteLine("vc: " + vc.ToString());
Console.Out.WriteLine("vba: " + vba.ToString());
Console.Out.WriteLine("vbc: " + vbc.ToString());
Console.Out.WriteLine("Angle(vba,vbc): " + Vector3D.AngleBetween(vba, vbc));
}
return (float)Vector3D.AngleBetween(vba, vbc);
}
示例5: ToStringAndParse
public void ToStringAndParse()
{
Vector3D vector = new Vector3D(0.0123, 9.876, -2.3);
string s = vector.ToString();
Vector3D parsedVector = Vector3D.Parse(s);
Assert.AreEqual(vector, parsedVector);
}
示例6: TestEquals
public void TestEquals()
{
Vector3D v0 = new Vector3D(678.0, 234.8, -123.987);
Vector3D v1 = new Vector3D(678.0, 234.8, -123.987);
Vector3D v2 = new Vector3D(67.0, 234.8, -123.987);
Vector3D v3 = new Vector3D(678.0, 24.8, -123.987);
Vector3D v4 = new Vector3D(678.0, 234.8, 123.987);
Assert.IsTrue(v0.Equals(v0));
Assert.IsTrue(v0.Equals(v1));
Assert.IsFalse(v0.Equals(v2));
Assert.IsFalse(v0.Equals(v3));
Assert.IsFalse(v0.Equals(v4));
Assert.IsFalse(v0.Equals(v0.ToString()));
}
示例7: process_data
private void process_data(Vector3D acc) {
_readingIndex++;
double len = acc.Length;
if (_max_value < len) {
_max_value = len;
}
_update_max_value_lbl();
_add_new_point("acc_x", _readingIndex, acc.x);
_add_new_point("acc_y", _readingIndex, acc.y);
_add_new_point("acc_z", _readingIndex, acc.z);
_add_new_point("v_len", _readingIndex, len + _length_offset);
if (chk_raw_data.Checked) {
_rtb_append(_readingIndex + " -> " + acc.ToString() + "\n");
}
}
开发者ID:andidegn,项目名称:VROOM---Vehicle-Remote-Observing-Organizational-Management,代码行数:15,代码来源:Form1.cs
示例8: TestToString
public void TestToString()
{
CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
try
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
Vector3D a = new Vector3D(1.23, 2.34, 3.45);
Assert.AreEqual("(1,23, 2,34, 3,45)", a.ToString());
}
finally
{
Thread.CurrentThread.CurrentCulture = originalCulture;
}
}