Segment.h

#pragma once


#include "Point.h"


namespace Robotics
{
    /// 線分
    public value class Segment
    {
    // Construction --------------------------------------------------------
    public:
        Segment( Point point1, Point point2 );


    // Operation -----------------------------------------------------------
    public:
        void ParallelTranslation( Point point );
        bool IsSamePoint();


    // Attribute ===========================================================
    private:
        Point m_point1;     ///< 点1
        Point m_point2;     ///< 点2


    // Property ------------------------------------------------------------
    public:
        /// 点1
        property Point Point1
        {
            Point get()
            {
                return m_point1;
            }
            void set( Point value )
            {
                m_point1 = value;
            }
        }

        /// 点2
        property Point Point2
        {
            Point get()
            {
                return m_point2;
            }
            void set( Point value )
            {
                m_point2 = value;
            }
        }


        /// 傾き
        property double Slope
        {
            double get();
        }

        /// Y切片
        property double YIntercept
        {
            double get();
        }
    };
}