void ShowResult()
        {
            // If we have the first two points, get the distance between
            // them, format the result, and display it.
            if (m_Point1 != null && m_Point2 != null)
            {
                double metric = Geom.Distance(m_Point1, m_Point2);
                distance1TextBox.Text = Format(metric, m_Point1, m_Point2);
            }

            // Same for the second pair of points.
            if (m_Point2 != null && m_Point3 != null)
            {
                double metric = Geom.Distance(m_Point2, m_Point3);
                distance2TextBox.Text = Format(metric, m_Point2, m_Point3);
            }

            // If we have all 3 points, display the angle.
            if (m_Point1 != null && m_Point2 != null && m_Point3 != null)
            {
                // Get the clockwise angle.
                Turn   reft = new Turn(m_Point2, m_Point1);
                double ang  = reft.GetAngleInRadians(m_Point3);

                // Get the complement if we actually want it anti-clockwise.
                if (!m_Clockwise)
                {
                    ang = Constants.PIMUL2 - ang;
                }

                angleTextBox.Text = RadianValue.AsString(ang);
            }
        }
Exemplo n.º 2
0
        internal override void ShowResult()
        {
            base.ShowResult();

            // Now show the bearings too. Don't bother if we've
            // only got 1 point, since that may involve more than
            // one circle (also true when we have 2 points, but in
            // that case, we use the first circle arbitrarily).

            if (Point1 != null && Point2 != null)
            {
                // It's conceivable that the two points share more than
                // one common circle. For now, just pick off the first
                // common circle and use that.
                Circle circle = FirstCommonCircle;
                if (circle == null)
                {
                    return;
                }

                // Get the bearing from the center to both points
                double bear1 = Geom.BearingInRadians(Point1, circle.Center);
                double bear2 = Geom.BearingInRadians(Point2, circle.Center);

                bearing1TextBox.Text = RadianValue.AsString(bear1);
                bearing2TextBox.Text = RadianValue.AsString(bear2);
            }
            else
            {
                bearing1TextBox.Text = bearing2TextBox.Text = "<no bearing>";
            }
        }
        internal override void ShowResult()
        {
            base.ShowResult();

            // Now show the bearing too.
            if (Point1 != null && Point2 != null)
            {
                double bearing = Geom.BearingInRadians(Point1, Point2);
                bearingTextBox.Text = RadianValue.AsString(bearing);
            }
        }