
struct float2
{
    float x, y;
};

static float
LenSqr(float2 v)
{
    float sum = v.x * v.x + v.y * v.y;
    return sum;
}

static float
Len(float2 v)
{
    return sqrtf(LenSqr(v));
}

static float2
Norm(float2 v)
{
    float len = Len(v);
    v.x = v.x / len;
    v.y = v.y / len;
    return v;
}

static float
Dot(float2 a, float2 b)
{
    return a.x * b.x + a.y * b.y;
}

