use std::ops;
use super::angle::Angle;
use crate::LARGE_EPSILON;
impl ops::Add<Angle> for Angle {
type Output = Angle;
fn add(self, _rhs: Angle) -> Angle {
Angle::from_rad(self.to_rad() + _rhs.to_rad())
}
}
impl ops::Add<&Angle> for Angle {
type Output = Angle;
fn add(self, _rhs: &Angle) -> Angle {
Angle::from_rad(self.to_rad() + _rhs.to_rad())
}
}
impl ops::Add<Angle> for &Angle {
type Output = Angle;
fn add(self, _rhs: Angle) -> Angle {
Angle::from_rad(self.to_rad() + _rhs.to_rad())
}
}
impl ops::Add<&Angle> for &Angle {
type Output = Angle;
fn add(self, _rhs: &Angle) -> Angle {
Angle::from_rad(self.to_rad() + _rhs.to_rad())
}
}
impl ops::AddAssign<Angle> for Angle {
fn add_assign(&mut self, rhs: Angle) {
*self = Angle::from_rad(self.to_rad() + rhs.to_rad());
}
}
impl ops::AddAssign<&Angle> for Angle {
fn add_assign(&mut self, rhs: &Angle) {
*self = Angle::from_rad(self.to_rad() + rhs.to_rad());
}
}
impl ops::Sub<Angle> for Angle {
type Output = Angle;
fn sub(self, _rhs: Angle) -> Angle {
Angle::from_rad(self.to_rad() - _rhs.to_rad())
}
}
impl ops::Sub<&Angle> for Angle {
type Output = Angle;
fn sub(self, _rhs: &Angle) -> Angle {
Angle::from_rad(self.to_rad() - _rhs.to_rad())
}
}
impl ops::Sub<Angle> for &Angle {
type Output = Angle;
fn sub(self, _rhs: Angle) -> Angle {
Angle::from_rad(self.to_rad() - _rhs.to_rad())
}
}
impl ops::Sub<&Angle> for &Angle {
type Output = Angle;
fn sub(self, _rhs: &Angle) -> Angle {
Angle::from_rad(self.to_rad() - _rhs.to_rad())
}
}
impl ops::SubAssign<Angle> for Angle {
fn sub_assign(&mut self, rhs: Angle) {
*self = Angle::from_rad(self.to_rad() - rhs.to_rad());
}
}
impl ops::SubAssign<&Angle> for Angle {
fn sub_assign(&mut self, rhs: &Angle) {
*self = Angle::from_rad(self.to_rad() - rhs.to_rad());
}
}
impl ops::Mul<f32> for Angle {
type Output = Angle;
fn mul(self, _rhs: f32) -> Angle {
Angle::from_rad(self.to_rad() * _rhs)
}
}
impl ops::Mul<f32> for &Angle {
type Output = Angle;
fn mul(self, _rhs: f32) -> Angle {
Angle::from_rad(self.to_rad() * _rhs)
}
}
impl ops::MulAssign<f32> for Angle {
fn mul_assign(&mut self, rhs: f32) {
*self = Angle::from_rad(self.to_rad() * rhs);
}
}
impl ops::Div<f32> for Angle {
type Output = Angle;
fn div(self, _rhs: f32) -> Angle {
Angle::from_rad(self.to_rad() / _rhs)
}
}
impl ops::Div<f32> for &Angle {
type Output = Angle;
fn div(self, _rhs: f32) -> Angle {
Angle::from_rad(self.to_rad() / _rhs)
}
}
impl ops::DivAssign<f32> for Angle {
fn div_assign(&mut self, rhs: f32) {
*self = Angle::from_rad(self.to_rad() / rhs);
}
}
impl PartialEq<Angle> for Angle {
fn eq(&self, rhs: &Angle) -> bool {
(self.to_rad() - rhs.to_rad()).abs() < LARGE_EPSILON
}
}
impl PartialEq<&Angle> for Angle {
fn eq(&self, rhs: &&Angle) -> bool {
(self.to_rad() - rhs.to_rad()).abs() < LARGE_EPSILON
}
}
impl PartialEq<Angle> for &Angle {
fn eq(&self, rhs: &Angle) -> bool {
(self.to_rad() - rhs.to_rad()).abs() < LARGE_EPSILON
}
}