Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="j1">tuple j1 such that exactly one element in j1 overlaps with j2</param>
        /// <param name="j2">tuple j2 such that exactly one element in j2 overlaps with j1</param>
        public JointTriple(JointTuple j1, JointTuple j2)
        {
            if (j1.Joint1 == j2.Joint1)
            {
                Joint2 = j1.Joint1;
                Joint1 = j1.Joint2;
                Joint3 = j2.Joint2;
            }
            else if (j1.Joint1 == j2.Joint2)
            {
                Joint2 = j1.Joint1;
                Joint1 = j1.Joint2;
                Joint3 = j2.Joint1;
            }
            else if (j1.Joint2 == j2.Joint2)
            {
                Joint2 = j1.Joint2;
                Joint1 = j1.Joint1;
                Joint3 = j2.Joint1;
            }
            else
            {
                throw new ArgumentException("No overlapping joint types");
            }

            if (Joint1 == Joint3)
            {
                throw new ArgumentException("Joints overlap completely");
            }

            InitializeTuples();
        }
Example #2
0
 private void InitializeTuples()
 {
     _t1 = new JointTuple(Joint2, Joint1);
     _t2 = new JointTuple(Joint2, Joint3);
 }
Example #3
0
 public static Vector3D Vector3DFromJointTuple(JointTuple t, Body b)
 {
     return(t.GetVector3D(b));
 }