/** * \brief Transform from current triangle to the target triangle */ Transform Triangle::to(const Triangle& target) const { double rotation = rotate_to(target); double scale = scale_to(target); Transform result(rotation, Point(), scale); Point translation = target.basepoint() - result(basepoint()); result = result + translation; return result; }
Vec3 unit(const Vec3 & nhs) { return scale_to(nhs, 1); }
Vec4 unit(const Vec4 & nhs) { return scale_to(nhs, 1); }