コード例 #1
0
        public double mainFunction(float alpha, float beta, float gamma, float deltaX, float deltaY, float deltaZ)
        {
            double sum       = 0;
            var    newPoints = TransformPoint.transformPoints(PointsA, alpha, beta, gamma, deltaX, deltaY, deltaZ);

            for (int i = 0; i < PointsA.Length; i++)
            {
                sum += Vector3.Distance(newPoints.ElementAt(i), PointsB[i]);
            }
            return(sum);
        }
コード例 #2
0
        public Variables CalculateGradient(float alpha, float beta, float gamma, float deltaX, float deltaY, float deltaZ)
        {
            Variables variables = new Variables();
            var       newPoints = TransformPoint.transformPoints(PointsA, alpha, beta, gamma, deltaX, deltaY, deltaZ);

            variables.alpha  = (float)gradientAlongAlpha(newPoints, alpha, beta, gamma, deltaX, deltaY, deltaZ);
            variables.beta   = (float)gradientAlongBeta(newPoints, alpha, beta, gamma, deltaX, deltaY, deltaZ);
            variables.gamma  = (float)gradientAlongGamma(newPoints, alpha, beta, gamma, deltaX, deltaY, deltaZ);
            variables.deltaX = (float)gradientAlongdeltaX(newPoints, alpha, beta, gamma, deltaX, deltaY, deltaZ);
            variables.deltaY = (float)gradientAlongdeltaY(newPoints, alpha, beta, gamma, deltaX, deltaY, deltaZ);
            variables.deltaZ = (float)gradientAlongdeltaZ(newPoints, alpha, beta, gamma, deltaX, deltaY, deltaZ);
            return(variables);
        }