Your heredoc terminator is wrong:
{
hyp=$(bc -l << EOF #LINE 34
scale = 9
sqrt ( $1 * $1 + $3 * $3 )
EOF
^^^^---these spaces count
Your terminator is now actually [space][space][space][space]EOF
, while bash is looking for EOF
WITHOUT the spaces. The terminator MUST begin at the start of the line, without any whitespace before (or after) it.
Since your heredoc never terminates, bash will run right off the end of the script looking for a )
which never comes, because the heredoc consumed the one you actually did have.