• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Degree类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Degree的典型用法代码示例。如果您正苦于以下问题:C# Degree类的具体用法?C# Degree怎么用?C# Degree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Degree类属于命名空间,在下文中一共展示了Degree类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            Teacher ta = new Teacher();
            Course cu = new Course("Programming with C#");
           
            for(int i = 1; i <= 3 ; i++){
                Student student = new Student("student"+i, "a" + i);
                for (int j = 0; j <= 4; j++) {
                    student.Grades.Push(100-(j*10));
                }
                   
                    cu.AddStudent(student);
            }

            cu.ListStudent();
            ta.FirstName = "ta";
            ta.LastName = "1";

            Degree dg = new Degree("Bachelor");

            UProgram up = new UProgram("Information Technology");

            Console.WriteLine("The {0} program contains the {1} of Science degree\r\n", up.ProgrameName, dg.DegreeName);
            Console.WriteLine("The {0} of Science degree contains the course {1}\r\n", dg.DegreeName, cu.CourseName);
            Console.WriteLine("The {0} course contain {1} studeent(s)", cu.CourseName, cu.countnum);
            Console.WriteLine("Press any key to continue....");
            Console.ReadKey();
        }
开发者ID:JouYin-Chen,项目名称:AssignmentHW,代码行数:28,代码来源:Program.cs


示例2: OnGetCameraTransform

        protected override void OnGetCameraTransform( out Vec3 position, out Vec3 forward,
			out Vec3 up, ref Degree cameraFov )
        {
            position = Vec3.Zero;
            forward = Vec3.XAxis;
            up = Vec3.ZAxis;

            Unit unit = GetPlayerUnit();
            if( unit == null )
                return;

            PlayerIntellect.Instance.FPSCamera = false;

            //To use data about orientation the camera if the cut scene is switched on
            if( IsCutSceneEnabled() )
            {
                if( CutSceneManager.Instance.GetCamera( out position, out forward, out up, out cameraFov ) )
                    return;
            }

            float distance = 25;
            position = unit.GetInterpolatedPosition() + new Vec3( 0, -distance, 0 );
            forward = Vec3.YAxis;
            up = Vec3.ZAxis;
        }
开发者ID:whztt07,项目名称:SDK,代码行数:25,代码来源:PlatformerDemoGameWindow.cs


示例3: AddBulletAndHit

        public bool AddBulletAndHit(VanillaCharacter source, Vector3 decalage, VanillaCharacter target)
        {
            Vector3 sourcePoint = source.FeetPosition + (source.Size.y / 2) * Vector3.UNIT_Y + decalage;
            Vector3 targetPoint = target.FeetPosition + target.Size.y / 2 * Vector3.UNIT_Y;
            Vector3 diff = targetPoint - sourcePoint;
            if (Math.Abs(diff.y / Cst.CUBE_SIDE) > 6) { return false; }

            Degree pitch = -Math.ATan2(diff.y,  diff.z);
            Degree yaw = source.GetYaw();
            if (yaw.ValueAngleUnits > 90 && yaw.ValueAngleUnits < 270)
            {
                yaw *= -1;
                yaw += new Degree(180);
            }

            float targetDistance = diff.Length;
            Ray ray = new Ray(sourcePoint + Vector3.NEGATIVE_UNIT_Z, diff.NormalisedCopy);
            float blockDistance = VanillaBlock.getBlockOnRay(source.getIsland(), ray, Bullet.DEFAULT_RANGE, 30);
            if (targetDistance > blockDistance) { return false; }

            SceneNode pitchNode = this.SceneMgr.RootSceneNode.CreateChildSceneNode();
            pitchNode.Position = sourcePoint;
            pitchNode.Pitch(pitch);

            SceneNode yawNode = pitchNode.CreateChildSceneNode();
            yawNode.Yaw(yaw);
            yawNode.AttachObject(StaticRectangle.CreateLine(this.SceneMgr, Vector3.ZERO, new Vector3(0, 0, 15), ColoredMaterials.YELLOW));

            this.mBullets.Add(new Bullet(source, target, pitchNode, yawNode));
            return true;
        }
开发者ID:RenaudWasTaken,项目名称:SkyLands,代码行数:31,代码来源:BulletManager.cs


示例4: FreeCameraMode

        /**
         * @param margin Collision margin
         * @param switchingMode Determine the state of the camera when switching to this camera mode from another
         */
        public FreeCameraMode(CameraControlSystem cam
              , Vector3 initialPosition
              , Degree initialRotationX
              , Degree initialRotationY
              , SwitchingMode switchingMode = SwitchingMode.CurrentState
              , float margin = 0.1f)
            : base(cam)
        {
            CameraCS = cam;
            Margin = margin;

            _fixedAxis = Vector3.UNIT_Y;
            _moveFactor = 1;
            _rotationFactor = 0.13f;
            _rotX = initialRotationX;
            _rotY = initialRotationY;
            _initialPosition = initialPosition;
            _initialRotationX = initialRotationX;
            _initialRotationY = initialRotationY;
            _lastRotationX = initialRotationX;
            _lastRotationY = initialRotationY;
            _lastPosition = initialPosition;
            _switchingMode = switchingMode;

            CameraPosition = initialPosition;

            this.CollisionFunc = this.DefaultCollisionDetectionFunction;
        }
开发者ID:andyhebear,项目名称:Mccs,代码行数:32,代码来源:FreeCameraMode.cs


示例5: EarthArea

 /// <summary>Создаёт трапециевидную область, содержащую все указанные точки</summary>
 /// <param name="Points">Массив точек, вокруг которых должна быть описана область</param>
 public EarthArea(params EarthPoint[] Points)
     : this()
 {
     MostWesternLongitude = new Degree(Points.Min(p => p.Longitude));
     MostEasternLongitude = new Degree(Points.Max(p => p.Longitude));
     MostSouthernLatitude = new Degree(Points.Min(p => p.Latitude));
     MostNorthenLatitude = new Degree(Points.Max(p => p.Latitude));
 }
开发者ID:NpoSaut,项目名称:netGeographicsLib,代码行数:10,代码来源:EarthArea.cs


示例6: DegreesFromComponents

		public void DegreesFromComponents()
		{
			Degree degree = new Degree(10, 20, 30, CoordinateType.Latitude);
			Assert.AreEqual(degree.CoordinateType, CoordinateType.Latitude);
			Assert.AreEqual(degree.Degrees, 10);
			Assert.AreEqual(degree.Minutes, 20);
			Assert.AreEqual(degree.Seconds, 30);
		}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:8,代码来源:DegreeTest.cs


示例7: LocRecord

 /// <summary>
 /// Creates a new instance of the LocRecord class.
 /// </summary>
 /// <param name="name">Name of the record.</param>
 /// <param name="timeToLive">Seconds the record should be cached at most.</param>
 /// <param name="version">Version number of representation.</param>
 /// <param name="size">Size of location in centimeters.</param>
 /// <param name="horizontalPrecision">Horizontal precision in centimeters.</param>
 /// <param name="verticalPrecision">Vertical precision in centimeters.</param>
 /// <param name="latitude">Latitude of the geographical position.</param>
 /// <param name="longitude">Longitude of the geographical position.</param>
 /// <param name="altitude">Altitude of the geographical position.</param>
 public LocRecord(string name, int timeToLive, byte version, double size, double horizontalPrecision, double verticalPrecision, Degree latitude, Degree longitude, double altitude)
     : base(name, RecordType.Loc, RecordClass.INet, timeToLive)
 {
     this.Version = version;
     this.Size = size;
     this.HorizontalPrecision = horizontalPrecision;
     this.VerticalPrecision = verticalPrecision;
     this.Latitude = latitude;
     this.Longitude = longitude;
     this.Altitude = altitude;
 }
开发者ID:alexbikfalvi,项目名称:InetAnalytics,代码行数:23,代码来源:LocRecord.cs


示例8: GetFactor

        // return between -1 and 1
        public static float GetFactor(Degree diffYaw)
        {
            float diffYawFloat = diffYaw.ValueAngleUnits;
            while (diffYawFloat > 180)   { diffYawFloat -= 360; }
            while (diffYawFloat <= -180) { diffYawFloat += 360; }
            int sign = System.Math.Sign(diffYawFloat);
            diffYawFloat *= sign;    // Take the abs value

            float factor = A * diffYawFloat * diffYawFloat + B * diffYawFloat; // Here factor is between 0 and 1
            return (factor > 1 ? 1 : factor) * sign;
        }
开发者ID:RenaudWasTaken,项目名称:SkyLands,代码行数:12,代码来源:YawFactor.cs


示例9: CMS

 public CMS(AEvent aDevice, CategoryType type, System.Collections.Hashtable ht, DeviceType devType, System.Collections.Hashtable DevRange, Degree degree)
 {
     Initialize(aDevice, type, ht, devType, DevRange, degree);
     this.GetMessRuleData += new GetMessRuleDataHandler(CMS_GetMessRuleData);
     List<object> messColors = (List<object>)com.select(DBConnect.DataType.MessColor, Command.GetSelectCmd.getMessColor());
     messColorsHT = new System.Collections.Hashtable();
     foreach (object obj in messColors)
     {
         MessColor mess = (MessColor)obj;
         messColorsHT.Add(mess.ID, mess);
     }
 }
开发者ID:ufjl0683,项目名称:Center,代码行数:12,代码来源:CMS.cs


示例10: Main

        static void Main(string[] args)
        {
            // Creating three student objects, since it's at least three.

            Student stud1 = new Student("Surya", "Raman", "[email protected]");
            Student stud2 = new Student("Narendra", "Mdoi","[email protected]");
            Student stud3 = new Student("Barack", "Obama", "[email protected]");

            //Now creating the course object with dev204X

            Course course = new Course("DEV204X", 5);

            //Using the method at the end of this code to add students to course

            course.addStudent(stud1);
            course.addStudent(stud2);
            course.addStudent(stud3);

            // Creating one teacher object since that's the minimum number

            Teacher teacher = new Teacher("Bruce", "Wayne", "[email protected]");

            // Using the method at the end of this code to add teacher to course

            course.addTeacher(teacher);

            // Creating Degree object, assuming Computer Science and Engineering degree

            Degree degree = new Degree("Computer Science and Engineering", 250, null);

            // Adding Course object to the Degree object

            degree.Course = course;

            //Creating UProgram object with Bachelor of Engineering

            UProgram uProgram = new UProgram("Bachelor of Engineering", "Lex Luthor", null);

            // Adding the Degree object to the UProgram object

            uProgram.Degree = degree;

            // Printing everything as per the Assignment instructions

            Console.WriteLine("The {0} program contains the {1} degree\n", uProgram.ProgramName, degree.DegreeName);

            Console.WriteLine("The {0} degree contains the course {1}\n", degree.DegreeName, course.CourseName);
            
            Console.WriteLine("The {0} course contains {1} student(s)\n", course.CourseName, course.studentNumber);
            Console.ReadKey();
        }
开发者ID:ayrusme,项目名称:DEV204x-Microsoft-CSharp,代码行数:51,代码来源:Program.cs


示例11: Kart

        public Kart(ThingBlock block, ThingDefinition def)
            : base(block, def)
        {
            DefaultMaxSpeed = MaxSpeed = def.GetFloatProperty("maxspeed", 180f);
            MaxReverseSpeed = def.GetFloatProperty("maxreversespeed", 4f);

            MaxSpeedSquared = MaxSpeed * MaxSpeed;
            MaxReverseSpeedSquared = MaxReverseSpeed * MaxReverseSpeed;

            IsInAir = false;

            FrontDriftAngle = new Degree(def.GetFloatProperty("FrontDriftAngle", 46)).ValueRadians;
            BackDriftAngle = new Degree(def.GetFloatProperty("BackDriftAngle", 55)).ValueRadians;
            DriftTransitionAngle = new Degree(def.GetFloatProperty("DriftTransitionAngle", 40));
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:15,代码来源:Kart.cs


示例12: DegreesTest

		public void DegreesTest()
		{
			Degree target = new Degree(20.5);
			Assert.AreEqual(20, target.Degrees);
			Assert.AreEqual(30, target.Minutes);
			Assert.AreEqual(0, target.Seconds);

			target = new Degree(-(10 + 21.0 / 60 + 34.22 / 3600));
			Assert.AreEqual(-10, target.Degrees);
			Assert.AreEqual(21, target.Minutes);
			Assert.AreEqual(34, target.Seconds);
			Assert.AreEqual(34.22, Math.Round(target.TotalSeconds, 3));

			target = new Degree(37.85);
			Assert.AreEqual(37, target.Degrees);
		}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:16,代码来源:DegreeTest.cs


示例13: OnGetCameraTransform

        protected override void OnGetCameraTransform( out Vec3 position, out Vec3 forward,
			out Vec3 up, ref Degree cameraFov )
        {
            position = Vec3.Zero;
            forward = Vec3.XAxis;
            up = Vec3.ZAxis;

            MapCamera mapCamera = Entities.Instance.GetByName( "MapCamera_0" ) as MapCamera;
            if( mapCamera != null )
            {
                position = mapCamera.Position;
                forward = mapCamera.Rotation * new Vec3( 1, 0, 0 );
                up = mapCamera.Rotation * new Vec3( 0, 0, 1 );
                if( mapCamera.Fov != 0 )
                    cameraFov = mapCamera.Fov;
            }
        }
开发者ID:whztt07,项目名称:SDK,代码行数:17,代码来源:PathfindingDemoGameWindow.cs


示例14: Main

 static void Main(string[] args)
 {
     string[] atts = { "Sophie", "Greene", "1/12/1991", "30 Some Street", "", "Leeds", "West Yorkshire", "ZE7 3AE", "UK","Student" };
     string[] att = { "Manual", "Zu", "1/12/1937", "30 Other Street", "", "Sheffield", "West Yorkshire", "LE7 9MN", "UK","Teacher" };
     Person student = new Person(atts);
     student.print();
     Person teacher = new Person(att);
     teacher.print();
     //ensure console window stays open
     string[] pAtt = {"Intro to Computer Science","Some Guy","BSc. blah blah" };
     UProgram prog = new UProgram(pAtt);
     prog.print();
     Degree deg = new Degree("Bsc. A M", 72);
     deg.print();
     Course cour = new Course("Intro hbla", 3, 9, "Mr blah Person");
     cour.print();
     Console.Read();
 }
开发者ID:sophie-greene,项目名称:Csharp,代码行数:18,代码来源:Program.cs


示例15: OnGetCameraTransform

        protected override void OnGetCameraTransform( out Vec3 position, out Vec3 forward, out Vec3 up,
            ref Degree cameraFov)
        {
            //camera management for demo mode
            if( demoMode && !FreeCameraEnabled )
            {
                MapCameraCurve curve;
                float curveTime;
                GetDemoModeMapCurve( out curve, out curveTime );
                if( curve != null )
                {
                    curve.CalculateCameraPositionByTime( curveTime, out position, out forward, out up,
                        out cameraFov );
                    return;
                }
            }

            base.OnGetCameraTransform( out position, out forward, out up, ref cameraFov );
        }
开发者ID:Eneth,项目名称:GAO,代码行数:19,代码来源:VillageDemoGameWindow.cs


示例16: OnGetCameraTransform

        protected override void OnGetCameraTransform( out Vec3 position, out Vec3 forward,
            out Vec3 up, ref Degree cameraFov)
        {
            if( ball != null && !ball.IsSetDeleted )
            {
                Vec3 lookAt = ball.GetInterpolatedPosition();
                Vec3 cameraPos = lookAt - cameraDirection.GetVector() * cameraDistance;

                position = cameraPos;
                forward = ( lookAt - position ).GetNormalize();
                up = Vec3.ZAxis;
            }
            else
            {
                position = Vec3.Zero;
                forward = Vec3.XAxis;
                up = Vec3.ZAxis;
            }
        }
开发者ID:Eneth,项目名称:GAO,代码行数:19,代码来源:BallGameWindow.cs


示例17: OnGetCameraTransform

        protected override void OnGetCameraTransform( out Vec3 position, out Vec3 forward, out Vec3 up,
			ref Degree cameraFov )
        {
            MapCamera mapCamera = FindFirstMapCamera();

            if( mapCamera != null )
            {
                position = mapCamera.Position;
                forward = mapCamera.Rotation.GetForward();
                up = mapCamera.Rotation.GetUp();
                cameraFov = mapCamera.Fov;
            }
            else
            {
                position = Vec3.Zero;
                forward = new Vec3( 1, 0, 0 );
                up = new Vec3( 0, 0, 1 );
                //fov = 90;
            }
        }
开发者ID:whztt07,项目名称:SDK,代码行数:20,代码来源:CatapultDemoGameWindow.cs


示例18: execute

        //indexers
        //explicit and implicit conversion

         //just for the sake of programming
        //Degree to Radian is implicit
        //Radian to Degree is explicit
        public void execute()
        {
            
            ClassA X = new ClassA();
            X[3] = 10;
            Debug.Log(X);
            
            Radian x = new Radian();
            x.value = Math.PI * 2;

            Degree degree = (Degree)x;
            Debug.Log(degree.value);

            Degree degree360 = new Degree();
            degree360.value = 360;

            Radian radian360 = degree360;//implicit
            Debug.Log(radian360.value);//2 Pi


        }
开发者ID:rahulkamra,项目名称:LearningCSharp,代码行数:27,代码来源:1443202094$Chap9.cs


示例19: getDisplyDevTypes

        public static ICommand getDisplyDevTypes(Degree degree, int alarmClass, string sectionid)
        {
            SelectCommand com = new SelectCommand();
            if (degree == Degree.L)
                com.FiledNames += string.Format(" Ruleid,devicetype ,lowdevicestart as devStart,lownormal as normal,lowsystem as system,lowisextend as isextend ");
            else if (degree == Degree.M)
                com.FiledNames += string.Format(" Ruleid,devicetype ,middevicestart as devStart,midnormal as normal,midsystem as system,midisextend as isextend ");
            else if (degree == Degree.H)
                com.FiledNames += string.Format(" Ruleid,devicetype ,highdevicestart as devStart,highnormal as normal,highsystem as system,highisextend as isextend ");
            else if (degree == Degree.S)
                com.FiledNames += string.Format(" Ruleid,devicetype ,superdevicestart as devStart,supernormal as normal,supersystem as system,superisextend as isextend ");
            else
                com.FiledNames += string.Format(" Ruleid,devicetype ");

            com.TblNames += string.Format(" {0}.{1} ", schema, DB2TableName.tblRSPDeviceRange);

            com.WhereCon += string.Format(" Ruleid in (select Ruleid from {0}.{1} where RUNING='Y') ", schema, DB2TableName.tblRSPRule);
            com.WhereCon += string.Format(" and ALARMCLASS={0} ", alarmClass);
            com.WhereCon += string.Format(" and SECTIONID='{0}' and devicetype = 'CMS' ", sectionid);

            return com;
        }
开发者ID:ufjl0683,项目名称:Center,代码行数:22,代码来源:GetSelectCommand.cs


示例20: GetFireParameters

        void GetFireParameters( out Vec3 pos, out Quat rot, out float speed )
        {
            Camera camera = RendererWorld.Instance.DefaultCamera;

            pos = catapult.Position + new Vec3( 0, 0, .7f );

            Radian verticalAngle = new Degree( 30 ).InRadians();

            rot = Quat.Identity;
            speed = 0;

            if( catapultFiring )
            {
                Ray startRay = camera.GetCameraToViewportRay( catapultFiringMouseStartPosition );
                Ray ray = camera.GetCameraToViewportRay( MousePosition );

                Plane plane = Plane.FromPointAndNormal( pos, Vec3.ZAxis );

                Vec3 startRayPos;
                if( !plane.RayIntersection( startRay, out startRayPos ) )
                {
                    //must never happen
                }

                Vec3 rayPos;
                if( !plane.RayIntersection( ray, out rayPos ) )
                {
                    //must never happen
                }

                Vec2 diff = rayPos.ToVec2() - startRayPos.ToVec2();

                Radian horizonalAngle = MathFunctions.ATan( diff.Y, diff.X ) + MathFunctions.PI;

                SphereDir dir = new SphereDir( horizonalAngle, verticalAngle );
                rot = Quat.FromDirectionZAxisUp( dir.GetVector() );

                float distance = diff.Length();

                //3 meters clamp
                MathFunctions.Clamp( ref distance, .001f, 3 );

                speed = distance * 10;
            }
        }
开发者ID:whztt07,项目名称:SDK,代码行数:45,代码来源:CatapultDemoGameWindow.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DelaunayTriangle类代码示例发布时间:2022-05-24
下一篇:
C# DeflateStream类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap