当前位置: 首页>>代码示例>>C#>>正文


C# SkeletonPoint.GetType方法代码示例

本文整理汇总了C#中Microsoft.Kinect.SkeletonPoint.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# SkeletonPoint.GetType方法的具体用法?C# SkeletonPoint.GetType怎么用?C# SkeletonPoint.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Kinect.SkeletonPoint的用法示例。


在下文中一共展示了SkeletonPoint.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LawOfCosinesPlanCalculation

        /// <summary>
        /// Calcula o angule entre os três joints enviados por parâmetros
        /// </summary>
        /// <param name="auxiliaryJointPosition">Posição do primeiro Joint</param>
        /// <param name="centerJointPosition">Posição do segundo Joint</param>
        /// <param name="auxiliary2JointPosition">Posição do terceiro Joint</param>
        /// <param name="firstAxis">Primeiro eixo para o cálculo</param>
        /// <param name="secondAxis">Segundo eixo para o cálculo</param>
        /// <returns>Retorna o resultado da lei dos cossenos em graus</returns>
        private static double LawOfCosinesPlanCalculation( SkeletonPoint auxiliaryJointPosition, SkeletonPoint centerJointPosition,SkeletonPoint auxiliary2JointPosition, Axis firstAxis, Axis secondAxis )
        {
            double firstAxisCenterJointPosition = centerJointPosition.GetType().GetProperty( firstAxis.ToString() ).GetValue( centerJointPosition, null ).To<double>();
            double secondAxisCenterJointPosition = centerJointPosition.GetType().GetProperty(secondAxis.ToString()).GetValue(centerJointPosition, null).To<double>();
            double firstAxisAuxiliaryJointPosition = auxiliaryJointPosition.GetType().GetProperty(firstAxis.ToString()).GetValue(auxiliaryJointPosition, null).To<double>();
            double secondAxisAuxiliaryJointPosition = auxiliaryJointPosition.GetType().GetProperty(secondAxis.ToString()).GetValue(auxiliaryJointPosition, null).To<double>();
            double firstAxisAuxiliaryJoint2Position = auxiliary2JointPosition.GetType().GetProperty(firstAxis.ToString()).GetValue(auxiliary2JointPosition, null).To<double>();
            double secondAxisAuxiliaryJoint2Position = auxiliary2JointPosition.GetType().GetProperty(secondAxis.ToString()).GetValue(auxiliary2JointPosition, null).To<double>();


            double a = StraightSegmentBetweenTwoJoints( firstAxisAuxiliaryJointPosition, secondAxisAuxiliaryJointPosition, firstAxisCenterJointPosition, secondAxisCenterJointPosition );
            double b = StraightSegmentBetweenTwoJoints( firstAxisCenterJointPosition, secondAxisCenterJointPosition, firstAxisAuxiliaryJoint2Position, secondAxisAuxiliaryJoint2Position );
            double c = StraightSegmentBetweenTwoJoints( firstAxisAuxiliaryJointPosition, secondAxisAuxiliaryJointPosition, firstAxisAuxiliaryJoint2Position, secondAxisAuxiliaryJoint2Position );

            double resultInRadians = Math.Acos( ( Math.Pow( a, 2 ) + Math.Pow( b, 2 ) - Math.Pow( c, 2 ) ) / ( 2 * a * b ) );
            double ResultInDegrees = resultInRadians * 180 / Math.PI;

            return ResultInDegrees;
        }
开发者ID:jorgeLuizChaves,项目名称:TCC,代码行数:28,代码来源:MathFunctionsManager.cs


注:本文中的Microsoft.Kinect.SkeletonPoint.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。