import math


def vec3(a, b, norm=1.0):
    """
    x,y,z <- vec3(a, b, norm=1.0)
    returns the vector a, b scale to norm
    """
    dx = b[0]-a[0]
    dy = b[1]-a[1]
    dz = b[2]-a[2]
    l = norm / math.sqrt( dx*dx + dy*dy +dz*dz)
    return [dx*l, dy*l, dz*l]