Пример #1
0
        public void Move(Double bearing, Double distance)
        {
            PointD np = FlatGeo.GetPoint(this, bearing, distance);

            _X = np.X;
            _Y = np.Y;
        }
Пример #2
0
        static Line LineFromCenterAndBearing(PointD centerPoint, Double bearing, Double distance)
        {
            PointD p1 = FlatGeo.GetPoint(centerPoint, Angle.Reverse(bearing), distance / 2);
            PointD p2 = FlatGeo.GetPoint(centerPoint, bearing, distance / 2);

            return(new Line(p1, p2));
        }
Пример #3
0
        void RecalculateAxes()
        {
            MajorAxis = new Line(
                FlatGeo.GetPoint(_center, Angle.Reverse(_majorAxisBearing), _majorAxisLength / 2),
                FlatGeo.GetPoint(_center, _majorAxisBearing, _majorAxisLength / 2));

            Double minorAxisBearing = Angle.Add(_majorAxisBearing, 90);

            MinorAxis = new Line(
                FlatGeo.GetPoint(_center, Angle.Reverse(minorAxisBearing), _minorAxisLength / 2),
                FlatGeo.GetPoint(_center, minorAxisBearing, _minorAxisLength / 2));
        }
Пример #4
0
        void RecalculateFociAndArea()
        {
            //      __________
            //    \/ r1² * r2²
            Double fociDistance = Math.Sqrt(MajorRadius * MajorRadius - MinorRadius * MinorRadius);

            Foci = new PointD[]
            {
                FlatGeo.GetPoint(Center, Angle.Reverse(MajorAxis.Bearing), fociDistance),
                FlatGeo.GetPoint(Center, MajorAxis.Bearing, fociDistance)
            };

            Eccentricity = new Line(Foci[0], Center).Length / new Line(Foci[0], MinorAxis.P1).Length;

            Area = Math.PI * MajorRadius * MinorRadius;
        }
Пример #5
0
 public PointD GetPointAt(Double bearing, Double distance)
 {
     return(FlatGeo.GetPoint(this, bearing, distance));
 }
Пример #6
0
 public PointD GetPointAt(BearingAndRange vector)
 {
     return(FlatGeo.GetPoint(this, vector.Bearing, vector.Range));
 }
Пример #7
0
 public Line(PointD origin, Double bearing, Double distance)
     : this(origin, FlatGeo.GetPoint(origin, bearing, distance))
 {
 }