#include "record.h"
#include <math.h>

double record_length(const record_t a)
{
    return sqrt(a.x * a.x + a.y * a.y);
}

double record_compare(const record_t a, const record_t b) 
{
    return record_length(a) - record_length(b);
}