#![no_std]
use core::ops::*;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct Point<A>(A);
impl<A: Sub<Output = A>> Point<A> {
#[inline(always)]
pub fn from_origin(a: A, o: A) -> Self { Point(a-o) }
}
impl<A: Add<Output = A>> Add<A> for Point<A> {
type Output = Self;
#[inline(always)]
fn add(self, other: A) -> Self { Point(self.0 + other) }
}
impl<A: Sub<Output = A>> Sub<A> for Point<A> {
type Output = Self;
#[inline(always)]
fn sub(self, other: A) -> Self { Point(self.0 - other) }
}
impl<A: AddAssign> AddAssign<A> for Point<A> {
#[inline(always)]
fn add_assign(&mut self, other: A) { self.0 += other }
}
impl<A: SubAssign> SubAssign<A> for Point<A> {
#[inline(always)]
fn sub_assign(&mut self, other: A) { self.0 -= other }
}
impl<A: Sub<Output = A>> Sub<Self> for Point<A> {
type Output = A;
#[inline(always)]
fn sub(self, other: Self) -> Self::Output { self.0 - other.0 }
}