The documentation has an example of “algebraic genericity”:
fn reflect_wrt_hyperplane<V>(plane_normal: &Unit<V>, vector: &V) -> V
where V: FiniteDimInnerSpace + Copy {
let n = plane_normal.as_ref(); // Get the underlying vector of type `V`.
*vector - *n * (n.dot(vector) * na::convert(2.0))
}
Are there more examples of this kind of genericity? Specifically, could such a function be extended to accepting not only a vector from the space V
, but also a matrix or similar that can transform such a vector into another vector in the same space?