Loading editor...

Scaling a vector

Scaling a vector only changes its norm, not its direction. E.g. given a one can modify the scale and watch the magnitude change:

A function to compute the norm looks like this (regular code fences are left untouched):

def norm(array):
    return sum(i**2 for i in array)**0.5

Math regions are never scanned for spans: and come through verbatim.