Skip to content

Add .scalarDivide to Matrix and Vector classes #79

@jbrown1618

Description

@jbrown1618

This is not technically a real matrix operation, but it is commonly needed, particularly for scaling. Right now, the approach commonly used is:

const inverse = ops.getMultiplicativeInverse(scaleFactor);
if (inverse === undefined) return someDefault;
return vector.scalarMultiply(inverse);

But this introduces a little bit of numerical error - 10 * (1/3) is less accurate than 10 / 3. We will need to re-implement NumberOperations.divide to get this to work correctly.

In particular, this will make the gauss-jordan equation solver more accurate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions