Angle.h
#pragma once
namespace Robotics
{
/// 角度
public value class Angle
{
// Construction --------------------------------------------------------
public:
explicit Angle( double angle );
explicit Angle( System::Decimal angle );
explicit Angle( System::Xml::XmlElement^ element );
// Operation -----------------------------------------------------------
public:
Angle% Near( Angle% reference1, Angle% reference2 );
virtual System::String^ ToString() override;
// static
public:
static bool IsExpressedByRadian( double angle );
static double CalculateDegree( double radian );
static double CalculateRadian( double degree );
static double CalculateRadian( System::Decimal degree );
// Overload ------------------------------------------------------------
public:
operator double() { return m_angle; }
Angle operator-();
Angle operator+=( double value );
Angle operator-=( double value );
Angle operator*=( double value );
Angle operator/=( double value );
bool Equals( Angle% obj ) new;
bool Equals( Angle% obj, double precision ) new;
static bool operator==( Angle% left, Angle% right );
static bool operator!=( Angle% left, Angle% right );
static Angle operator+( Angle% obj, double value );
static Angle operator+( double value, Angle% obj );
static Angle operator+( Angle% left, Angle% right );
static Angle operator-( Angle% obj, double value );
static Angle operator-( double value, Angle% obj );
static Angle operator-( Angle% left, Angle% right );
// Attribute ===========================================================
private:
double m_angle; ///< 角度[ rad ]
// Property ------------------------------------------------------------
public:
/// Degree[ deg ]
property double Degree
{
double get()
{
return CalculateDegree( m_angle );
}
void set( double value )
{
m_angle = CalculateRadian( value );
}
}
};
}