bool float4::IsPerpendicular(const float4 &other, float epsilonSq) const { float dot = Dot(other); return dot*dot <= epsilonSq * LengthSq() * other.LengthSq(); }
float4 float4::ProjectTo(const float4 &target) const { assume(!target.IsZero()); assume(this->IsWZeroOrOne()); return target * (this->Dot(target) / target.LengthSq()); }