where f e ∈ ∈ R 3 is the sum of all external forces on the body. The multi-case definition of t ^ ^ is required for robustly computing the actual friction force f f ∈ ∈ R 3 for both the general and particular states of contact. Informally, the first case computes the tangent vector along the relative velocity component perpendicular to the contact normal n ^ ^ . If this component is zero, the second case derives t ^ ^ in terms of the tangent component of the external force f e ∈ ∈ R 3 . If there is no tangential velocity or external forces, then no friction is assumed, and t ^ ^ may be set to the zero vector. Thus, f f ∈ ∈ R 3 is computed as