コード例 #1
0
            protected bool Equals(KLTranslation other)
            {
                var innerProduct = Math.Abs(Math.Abs(Matrix.InnerProduct(Translation, other.Translation)) - 1);

                if (innerProduct < 0.01)
                {
                    return(true);
                }
                return(false);
            }
コード例 #2
0
 public bool ContainsRotation(double[] newRotation)
 {
     foreach (var rot in Rotation)
     {
         var innerProduct = Math.Abs(Math.Abs(Matrix.InnerProduct(rot.RotationAxis, newRotation)) - 1);
         if (innerProduct < 0.01)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #3
0
 public bool ContainsTranslation(double[] newTranslation)
 {
     foreach (var trasl in Translation)
     {
         var innerProduct = Math.Abs(Math.Abs(Matrix.InnerProduct(trasl.Translation, newTranslation)) - 1);
         if (innerProduct < 0.01)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #4
0
            protected bool Equals(KLRotation other)
            {
                var innerProduct = Math.Abs(Math.Abs(Matrix.InnerProduct(RotationAxis, other.RotationAxis)) - 1);

                if (innerProduct < 0.01)
                {
                    if (RotationPoint != null && other.RotationPoint != null)
                    {
                        var pointDifferent = new double[]
                        {
                            RotationPoint[0] - other.RotationPoint[0], RotationPoint[1] - other.RotationPoint[1],
                            RotationPoint[2] - other.RotationPoint[2]
                        };
                        var norm = Norm.Euclidean(pointDifferent);
                        if (norm != 0.0)
                        {
                            pointDifferent = pointDifferent.Divide(norm);
                        }
                        else
                        {
                            return(true);
                        }
                        var innerProduct2 = Math.Abs(Math.Abs(Matrix.InnerProduct(RotationAxis, pointDifferent)) - 1);

                        //if (FolderUtilities.FolderUtilities.KLIsVectorNull(pointDifferent, 0.01))
                        //{
                        //    return true;
                        //}
                        //else
                        if (innerProduct2 < 0.01)
                        {
                            return(true);
                        }
                    }
                    else if (RotationPoint == null || other.RotationPoint == null)
                    {
                        return(true);
                    }
                }

                return(false);
            }