public void SetPerpenticularTo(Int2 r_) { //unity coordinate system default x = -r_.y; y = r_.x; }
public static Int2 LerpClamp(Int2 a_, Int2 b_, N2 p_, N2 t_) => Lerp(a_, b_, GenericMath.Clamp(p_, 0, t_), t_);
public static N2 Dot(Int2 a_, Int2 b_) { checked { return((N2)a_.x * b_.x + (N2)a_.y * b_.y); } }
public static Int2 Lerp(Int2 a_, Int2 b_, N2 p_, N2 t_) => a_ + Scale(b_ - a_, p_, t_);