Matrix.rotFromTo

Returns rotation matrix which converts a vector to another vector.

  1. Matrix rotFromTo(Vector!(T, 3) from, Vector!(T, 3) to)
  2. Matrix rotFromTo(Vector!(T, 3) from, Vector!(T, 3) to)
    struct Matrix(T, uint U, uint V)
    static
    static if(U == V)
    static if(!(U == 3))
    static if(U == 4)
    rotFromTo
    (
    const Vector!(T, 3) from
    ,
    const Vector!(T, 3) to
    )
    if (
    __traits(isArithmetic, T)
    )

Parameters

from Vector!(T, 3)

before vector, which must be normalized

to Vector!(T, 3)

after vector, which must be normalized

Return Value

Type: Matrix

rotation matrix

Meta