Code:
dist = ((int)targheight * float sin(((3.14159 / 2) ...
should be
Code:
dist = ((int)targheight * (float) sin(((3.14159 / 2) ...
^^^^
to recap:
1. make sure parenthesis are properly matched up
2. type casts such as int and float need to be in their own parenthesis
like you did with (int) already