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

C# System.Angle类代码示例

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

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



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

示例1: Rotate

 public static void Rotate(this IEnumerable<PlaneRegion> passedPlaneRegions, Line passedAxisLine, Angle passedRotationAngle)
 {
     foreach (var planeRegion in passedPlaneRegions)
     {
         planeRegion.Rotate(passedAxisLine, passedRotationAngle);
     }
 }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:7,代码来源:PlaneRegionListExtensionMethods.cs


示例2: FindNearestNeighbors

        private static Dictionary<Cluster, Cluster> FindNearestNeighbors(List<Cluster> c1l, List<Cluster> c2l, out List<Angle> angles, Angle angleBase, Angle angleTolerance)
        {
            Dictionary<Cluster, Cluster> neighbors = new Dictionary<Cluster, Cluster>();
            angles = new List<Angle>();
            foreach (Cluster c1 in c1l)
            {
                float shortestDistance = 999999;
                Cluster shortestCluster = null;

                foreach (Cluster c2 in c2l)
                {
                    if (new Angle(Math.Abs((c1.GetAngle(c2) - angleBase).angleDegrees)).angleDegrees > angleTolerance.angleDegrees)
                        continue;
                    //if (Math.Abs(Cluster.CompareAngles(c1.GetAngle(c2), angleBase)) > angleTolerance.angleDegrees)

                    float currentDistance = c1.Distance(c2);
                    if (currentDistance < shortestDistance)
                    {
                        shortestCluster = c2;
                        shortestDistance = currentDistance;
                    }
                    if (shortestDistance == 0)
                    {
                    }
                }
                if (shortestCluster != null)
                {
                    neighbors.Add(c1, shortestCluster);
                    angles.Add(c1.GetAngle(shortestCluster));
                }
            }
            return neighbors;
        }
开发者ID:NuzzIndustries,项目名称:TopCoderMarathon2,代码行数:33,代码来源:DualAdjacentClusterMerge.cs


示例3: PolarCoordinate

 public PolarCoordinate(float r, double theta, Azimuth origin, PolarCoordinateOrientation orientation)
 {
     _R = r;
     _Theta = new Angle(theta);
     _Origin = origin;
     _Orientation = orientation;
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:7,代码来源:PolarCoordinate.cs


示例4: Button_Click1

        private void Button_Click1(object sender, RoutedEventArgs e)
        {
            int aangle, bangle;

            Csubbox.Text = "";

            aangle = Convert.ToInt32(Asubbox.Text);
            bangle = Convert.ToInt32(Bsubbox.Text);

            if (aangle < 0 || aangle > 360 || bangle < 0 || bangle > 360)
            {
                MessageBox.Show("Углы должны быть в диапазоне от 0 до 360 градусов");
                return;
            }

            Angle A = new Angle();
            Angle B = new Angle();

            A.deg = aangle;
            B.deg = bangle;

            double res;

            res = A.Sub(B);

            Csubbox.Text = res.ToString();
        }
开发者ID:VoyagerX,项目名称:Test,代码行数:27,代码来源:MainWindow.xaml.cs


示例5: Arc

 /// <summary>
 /// Creates a new Arc
 /// </summary>
 /// <param name="radius">The radius of the arc</param>
 /// <param name="angle">The arc angle</param>
 /// <param name="baseVector">A vector of the arc start</param>
 public Arc(double? radius, Angle? angle, Vector2 baseVector)
 {
     _angle = angle;
     _radius = radius;
     _base = baseVector;
     _bowlen = null;
 }
开发者ID:ElderByte-,项目名称:Archimedes.Geometry,代码行数:13,代码来源:Arc.cs


示例6: CalculateNewPosition

        //////////////////////////////////////////////////////////////////////////////////////
        // This method takes in present position (LatLongClass) and range/bearing from the
        // present position. It returns a new position (LatLongClass)
        //
        // Distance is IN
        // Azimuth in degrees
        public static LatLongClass CalculateNewPosition(LatLongClass PresentPosition, double Distance, double Azimuth)
        {
            LatLongClass NewPosition = new LatLongClass();

            // instantiate the calculator
            GeodeticCalculator geoCalc = new GeodeticCalculator();

            // select a reference elllipsoid
            Ellipsoid reference = Ellipsoid.WGS84;

            // set Lincoln Memorial coordinates
            GlobalCoordinates Present_Pos;
            Present_Pos = new GlobalCoordinates(new Angle(PresentPosition.GetLatLongDecimal().LatitudeDecimal), new Angle(PresentPosition.GetLatLongDecimal().LongitudeDecimal));

            // now, plug the result into to direct solution
            GlobalCoordinates dest;
            Angle endBearing = new Angle();

            double Distance_In_Meeters = (Distance * NMtoKM * 1000.0);

            dest = geoCalc.CalculateEndingGlobalCoordinates(reference, Present_Pos, Azimuth, Distance_In_Meeters, out endBearing);
            NewPosition.SetPosition(new LatLongDecimal(dest.Latitude.Degrees, dest.Longitude.Degrees));

            return NewPosition;
        }
开发者ID:akapetanovic,项目名称:ASTERIX-ANALYSER-and-DATA-DISPLAY,代码行数:31,代码来源:GeoCordSystem.cs


示例7: SetType

        internal void SetType(ParticleType type)
        {
            Type = type;

            Scale = Type.ScaleModifier.Random;
            Angle = Type.AngleModifier.Random;
            Alpha = Type.AlphaModifier.Random;

            LifeMax = (int)Math.Round(Type.realLife.Random);
            Life = 0;
            LifePercent = 0;

            if (Type.Mode == ParticleType.FrameMode.Random)
                Frame = (int)Calc.Random.Next(Type.Sprite.Length);
            else
                Frame = 0;

            if (Type.BlendWithTime)
                Color = Type.Blend[0];
            else
                Color = Calc.Random.Choose(Type.Blend);

            Velocity = new Angle(Type.Direction.Random, true).ToVector(Type.Speed.Random);

            DrawScale = new Vector2(Type.ScaleX.Min, Type.ScaleY.Min) * Type.Size.Min * Scale;
            DrawAngle = new Angle(Type.Angle.Min + Angle, true);
        }
开发者ID:BeauPrime,项目名称:Networking,代码行数:27,代码来源:Particle.cs


示例8: QuadTile

        /// <summary>
        /// Initializes a new instance of the <see cref= "T:WorldWind.Renderable.QuadTile"/> class.
        /// </summary>
        /// <param name="south"></param>
        /// <param name="north"></param>
        /// <param name="west"></param>
        /// <param name="east"></param>
        /// <param name="level"></param>
        /// <param name="quadTileSet"></param>
        public QuadTile(double south, double north, double west, double east, int level, QuadTileSet quadTileSet)
        {
            this.South = south;
            this.North = north;
            this.West = west;
            this.East = east;
            CenterLatitude = Angle.FromDegrees(0.5f*(North + South));
            CenterLongitude = Angle.FromDegrees(0.5f*(West + East));
            LatitudeSpan = Math.Abs(North - South);
            LongitudeSpan = Math.Abs(East - West);

            this.Level = level;
            this.QuadTileSet = quadTileSet;

            BoundingBox = new BoundingBox((float) south, (float) north, (float) west, (float) east, (float) quadTileSet.LayerRadius, (float) quadTileSet.LayerRadius + 300000f);
            //localOrigin = BoundingBox.CalculateCenter();
            localOrigin = MathEngine.SphericalToCartesianD(CenterLatitude, CenterLongitude, quadTileSet.LayerRadius);

            // To avoid gaps between neighbouring tiles truncate the origin to
            // a number that doesn't get rounded. (nearest 10km)
            localOrigin.X = (float) (Math.Round(localOrigin.X/10000)*10000);
            localOrigin.Y = (float) (Math.Round(localOrigin.Y/10000)*10000);
            localOrigin.Z = (float) (Math.Round(localOrigin.Z/10000)*10000);

            Row = MathEngine.GetRowFromLatitude(South, North - South);
            Col = MathEngine.GetColFromLongitude(West, North - South);
        }
开发者ID:beginor,项目名称:WorldWind,代码行数:36,代码来源:QuadTile.cs


示例9: TwoDimensionalDirectCalculation

	/// <summary>
	/// Calculate the destination if we start at:
	///    Lincoln Memorial in Washington, D.C --> 38.8892N, 77.04978W
	///         and travel at
	///    51.7679 degrees for 6179.016136 kilometers
	/// 
	///    WGS84 reference ellipsoid
	/// </summary>
	static void TwoDimensionalDirectCalculation()
	{
	  // instantiate the calculator
	  GeodeticCalculator geoCalc = new GeodeticCalculator();

	  // select a reference elllipsoid
	  Ellipsoid reference = Ellipsoid.WGS84;

	  // set Lincoln Memorial coordinates
	  GlobalCoordinates lincolnMemorial;
	  lincolnMemorial = new GlobalCoordinates(
		  new Angle(38.88922), new Angle(-77.04978)
	  );

	  // set the direction and distance
	  Angle startBearing = new Angle(51.7679);
	  double distance = 6179016.13586;

	  // find the destination
	  Angle endBearing;
	  GlobalCoordinates dest = geoCalc.CalculateEndingGlobalCoordinates(reference, lincolnMemorial, startBearing, distance, out endBearing);

	  Console.WriteLine("Travel from Lincoln Memorial at 51.767921 deg for 6179.016 km");
	  Console.Write("   Destination: {0:0.0000}{1}", dest.Latitude.Degrees, (dest.Latitude > 0) ? "N" : "S" );
	  Console.WriteLine(", {0:0.0000}{1}", dest.Longitude.Degrees, (dest.Longitude > 0) ? "E" : "W");
	  Console.WriteLine("   End Bearing: {0:0.00} degrees", endBearing.Degrees);
	}
开发者ID:heinzsack,项目名称:DEV,代码行数:35,代码来源:Example.cs


示例10: TestRotateAroundOrigin

 public void TestRotateAroundOrigin()
 {
     Angle a = new Angle(90, Angle.Representation.Degree);
     Point p1 = new Point(2.5, 0.0);
     var rotated = Rotation.AroundOrigin(a, p1);
     Assert.AreEqual(0.0, rotated.X, 0.01);
     Assert.AreEqual(2.5, rotated.Y, 0.01);
 }
开发者ID:ZoolWay,项目名称:Geometry,代码行数:8,代码来源:RotationTest.cs


示例11: GetPoint

        /// <summary>
        /// Returns a point on this circle at the given angle offset.
        /// </summary>
        /// <param name="angle"></param>
        /// <returns></returns>
        public Vector2 GetPoint(Angle angle){
            var circlePoint = new Vector2(
                Math.Cos(angle.Radians) * this.Radius,
                Math.Sin(angle.Radians) * this.Radius);

            circlePoint += this.Location;
            return circlePoint;
        }
开发者ID:ElderByte-,项目名称:Archimedes.Geometry,代码行数:13,代码来源:Circle2.cs


示例12: ConvertDegreesMinutesSeconds

    public void ConvertDegreesMinutesSeconds()
    {
      Angle angle = new Angle(10, 30, 20);
      Assert.IsTrue(TestingUtils.AreEqualWithinTolerance(angle.Degrees, 10.505555556));

      angle = new Angle(-10, 30, 20);
      Assert.IsTrue(TestingUtils.AreEqualWithinTolerance(angle.Degrees, 10.505555556));
    }
开发者ID:heinzsack,项目名称:DEV,代码行数:8,代码来源:AngleTest.cs


示例13: Rotate_100x0yPlus45_71x71y

		public void Rotate_100x0yPlus45_71x71y()
		{
			var velocity = new Velocity(10, 0);
			var angle = new Angle(Math.PI / 4d);
			var act = velocity.Rotate(angle);
			var exp = new Velocity(Math.Sqrt(50), Math.Sqrt(50));

			CloudBallAssert.AreEqual(exp, act);
		}
开发者ID:Corniel,项目名称:CloudBall.LostKeysUnited,代码行数:9,代码来源:VelocityTest.cs


示例14: TestRotateAroundPoint

 public void TestRotateAroundPoint()
 {
     Angle a = new Angle(45, Angle.Representation.Degree);
     Point c1 = new Point(0.5, 0.5);
     Point p1 = new Point(1, 2);
     var rotated = Rotation.AroundPoint(c1, a, p1);
     Assert.AreEqual(-0.2071, rotated.X, 0.01);
     Assert.AreEqual(1.9142, rotated.Y, 0.01);
 }
开发者ID:ZoolWay,项目名称:Geometry,代码行数:9,代码来源:RotationTest.cs


示例15: Latitude

 // Prevent null reference access
 /// <summary>Initializes a new instance of the Latitude class.</summary>
 /// <param name="angle">The angle of the latitude.</param>
 /// <exception cref="ArgumentNullException">angle is null.</exception>
 /// <exception cref="ArgumentOutOfRangeException">
 /// angle is greater than 90 degrees or less than -90 degrees.
 /// </exception>
 public Latitude(Angle angle)
     : base((angle ?? new Angle(0)).Radians)
 {
     if (angle == null)
     {
         throw new ArgumentNullException("angle");
     }
     ValidateRange("angle", angle.Radians, -Math.PI / 2.0, Math.PI / 2.0);
 }
开发者ID:rbdavison,项目名称:YachtSim,代码行数:16,代码来源:Latitude.cs


示例16: HemisphereAngleConstructorTest1

        public void HemisphereAngleConstructorTest1()
        {
            Angle angle = new Angle(0);

            Latitude latitude = new Latitude(angle,CardinalDirection.South);

            Assert.AreEqual(angle, latitude.Value);
            Assert.AreEqual(angle, latitude.RawValue);
        }
开发者ID:jmaxxz,项目名称:Ares,代码行数:9,代码来源:LatitudeTest.cs


示例17: Rotate_Minus135_71x71y

		public void Rotate_Minus135_71x71y()
		{
			var velocity = new Velocity(10, 0);
			var angle = new Angle(-3 * Math.PI / 4d);
			var act = velocity.Rotate(angle);
			var exp = new Velocity(-Math.Sqrt(50), -Math.Sqrt(50));

			CloudBallAssert.AreEqual(exp, act);
		}
开发者ID:Corniel,项目名称:CloudBall.LostKeysUnited,代码行数:9,代码来源:VelocityTest.cs


示例18: SailAngle

 // Prevent null reference access
 public SailAngle(Angle angle)
     : base((angle ?? new Angle(0)).Radians)
 {
     if (angle == null)
     {
         throw new ArgumentNullException("angle");
     }
     ValidateRange("SailAngle", angle.TotalDegrees, 0, 90);
 }
开发者ID:rbdavison,项目名称:YachtSim,代码行数:10,代码来源:SaleAngle.cs


示例19: Longitude

 // Prevent null reference access, we'll validate later
 /// <summary>Initializes a new instance of the Longitude class.</summary>
 /// <param name="angle">The angle of the longitude.</param>
 /// <exception cref="ArgumentNullException">angle is null.</exception>
 /// <exception cref="ArgumentOutOfRangeException">
 /// angle is greater than 180 degrees or less than -180 degrees.
 /// </exception>
 public Longitude(Angle angle)
     : this((angle ?? new Angle(0)).Radians)
 {
     if (angle == null)
     {
         throw new ArgumentNullException("angle");
     }
     ValidateRange("angle", angle.Radians, -Math.PI, Math.PI);
 }
开发者ID:rbdavison,项目名称:YachtSim,代码行数:16,代码来源:Longitude.cs


示例20: TestSin

        public void TestSin()
        {
            Angle a = new Angle(90, Angle.Representation.Degree);
            double sin90 = Trigonometry.Sin(a);
            Assert.AreEqual(1, sin90, 0.01);

            Angle b = new Angle(0.5); // radians
            double sin05rad = Trigonometry.Sin(b);
            Assert.AreEqual(0.47942, sin05rad, 0.01);
        }
开发者ID:ZoolWay,项目名称:Geometry,代码行数:10,代码来源:TrigonometryTest.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# System.App类代码示例发布时间:2022-05-26
下一篇:
C# System.AggregateException类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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