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


C# Vector3D.MagSquared方法代码示例

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


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

示例1: DistancePointPlane

        public static double DistancePointPlane( Vector3D normalVector, Vector3D planePoint, Vector3D point )
        {
            // Check to make sure that plane is not degenerate.
            if( Tolerance.Zero( normalVector.MagSquared() ) )
                return double.NaN;

            // Here is the distance (signed depending on which side of the plane we are on).
            return ( point - planePoint ).Dot( normalVector ) / normalVector.Abs();
        }
开发者ID:roice3,项目名称:Honeycombs,代码行数:9,代码来源:Euclidean3D.cs

示例2: DistancePointLine

        public static double DistancePointLine( Vector3D n1, Vector3D p1, Vector3D point )
        {
            // Check to make sure that n1 is not degenerate.
            if( Tolerance.Zero( n1.MagSquared() ) )
                return double.NaN;

            // ZZZ - Can we make this a signed distance?
            return ( ( point - p1 ).Cross( n1 ) ).Abs() / n1.Abs();
        }
开发者ID:roice3,项目名称:Honeycombs,代码行数:9,代码来源:Euclidean3D.cs

示例3: PlaneToSphere

 /// <summary>
 /// Sphere geometry is implicit.  A radius 1 sphere with the center at the origin.
 /// </summary>
 public static Vector3D PlaneToSphere( Vector3D planePoint )
 {
     planePoint.Z = 0;	// Just to be safe.
     double magSquared = planePoint.MagSquared();
     Vector3D result = new Vector3D(
         2 * planePoint.X / ( 1.0 + magSquared ),
         2 * planePoint.Y / ( 1.0 + magSquared ),
         ( magSquared - 1.0 ) / ( magSquared + 1.0 ) );
     return result;
 }
开发者ID:roice3,项目名称:Honeycombs,代码行数:13,代码来源:Spherical2D.cs

示例4: DistanceLineLine

        public static double DistanceLineLine( Vector3D n1, Vector3D p1, Vector3D n2, Vector3D p2 )
        {
            // Check to make sure that neither of the normal vectors are degenerate.
            if( Tolerance.Zero( n1.MagSquared() ) || Tolerance.Zero( n2.MagSquared() ) )
                return double.NaN;

            Vector3D plane = n1.Cross( n2 );

            //	Case where the lines are parallel (magnitude of the cross product will be 0).
            if( Tolerance.Zero( plane.MagSquared() ) )
                return DistancePointLine( n1, p1, p2 );

            return DistancePointPlane( plane, p1, p2 );
        }
开发者ID:roice3,项目名称:Honeycombs,代码行数:14,代码来源:Euclidean3D.cs

示例5: DivideQuat

 private Vector3D DivideQuat( Vector3D a, Vector3D b )
 {
     double magSquared = b.MagSquared();
     Vector3D bInv = new Vector3D( b.X / magSquared, -b.Y / magSquared, -b.Z / magSquared, -b.W / magSquared );
     return MultQuat( a, bInv );
 }
开发者ID:roice3,项目名称:Honeycombs,代码行数:6,代码来源:Mobius.cs

示例6: HDist

 /// <summary>
 /// Returns the hyperbolic distance between two points.
 /// </summary>
 public static double HDist( Vector3D u, Vector3D v )
 {
     double isometricInvariant = 2 * ( u - v ).MagSquared() / ( ( 1.0 - u.MagSquared() ) * ( 1.0 - v.MagSquared() ) );
     return DonHatch.acosh( 1 + isometricInvariant );
 }
开发者ID:roice3,项目名称:Honeycombs,代码行数:8,代码来源:H3Utils.cs

示例7: Geodesic

 public static void Geodesic( Vector3D v1, Vector3D v2, out Vector3D center, out double radius, out Vector3D normal, out double angleTot )
 {
     bool finite = !Tolerance.Equal( v1.MagSquared(), 1 ) || !Tolerance.Equal( v2.MagSquared(), 1 );
     if( finite )
     {
         Circle3D c;
         H3Models.Ball.OrthogonalCircleInterior( v1, v2, out c );
         center = c.Center;
         radius = c.Radius;
     }
     else
         H3Models.Ball.OrthogonalCircle( v1, v2, out center, out radius );
     Vector3D t1 = v1 - center;
     Vector3D t2 = v2 - center;
     t1.Normalize();	// This was necessary so that the cross product below didn't get too small.
     t2.Normalize();
     normal = ( t1 ).Cross( t2 );
     normal.Normalize();
     angleTot = ( t1 ).AngleTo( t2 );
 }
开发者ID:roice3,项目名称:Honeycombs,代码行数:20,代码来源:H3Utils.cs


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