Find the intersection of two lines

sub intersection (Real $ax, Real $ay, Real $bx, Real $by,
                  Real $cx, Real $cy, Real $dx, Real $dy ) {

    sub term:<|AB|> { determinate($ax, $ay, $bx, $by) }
    sub term:<|CD|> { determinate($cx, $cy, $dx, $dy) }

    my xAB = $ax - $bx;
    my yAB = $ay - $by;
    my xCD = $cx - $dx;
    my yCD = $cy - $dy;

    my $x-numerator = determinate( |AB|, xAB, |CD|, xCD );
    my $y-numerator = determinate( |AB|, yAB, |CD|, yCD );
    my $denominator = determinate( xAB, yAB, xCD, yCD );

    return 'Lines are parallel' if $denominator == 0;

    ($x-numerator/$denominator, $y-numerator/$denominator);
}

sub determinate ( Real $a, Real $b, Real $c, Real $d ) { $a * $d - $b * $c }

# TESTING
say 'Intersection point: ', intersection( 4,0, 6,10, 0,3, 10,7 );
say 'Intersection point: ', intersection( 4,0, 6,10, 0,3, 10,7.1 );
say 'Intersection point: ', intersection( 0,0, 1,1, 1,2, 4,5 );

Output:

Intersection point: (5 5)
Intersection point: (5.010893 5.054466)
Intersection point: Lines are parallel