Skip to content

Applying a lambda to a vector treats the vector as a number #2132

Closed

Description

@Rafael-SOWNet

Applying a lambda to a vector gives a matrix of vectors where it should multiply:

Input Answer Should be
apply(lambda(u, [[0, -1], [1, 0]] * u), [p, q]) [[0, [-p, -q]], [[p, q], 0]] [-q, p]
apply(lambda(u, [1, 1]T * u), [p, q]) [[[p, q], [p, q]]] p + q

Written out, [[0, -1], [1, 0]] * [p, q] simplifies to [-q, p]. The body on its own, [[0, -1], [1, 0]] * u, simplifies to [[0, -u], [u, 0]]. That is right when u is a number, and the answer is that matrix with the vector put in for u.

Found while reading Modenov's Problems in Geometry for #2131, where this lambda is the book's rotation of a plane vector through π/2. Related: #495.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions