type triangle = {a : float; b: float; theta : float} ;;

let rad theta =
  let pi = acos ~-.1. in
  theta *. pi /. 180. ;;

let sin_theta theta = sin (rad theta) ;;
let cos_theta theta = cos (rad theta) ;;

let area a b theta = a *. b *. (sin_theta theta) /. 2. ;;
let perimeter a b theta = a +. b +. sqrt( a *. a +. b *. b -. 2. *. a *. b *. (cos_theta theta)) ;;
let height b theta = b *. sin_theta theta ;;

let () =
  let a, b, theta = Scanf.scanf "%f %f %f\n" (fun x y z -> x, y, z) in
  Printf.printf "%10f\n" (area a b theta);
  Printf.printf "%10f\n" (perimeter a b theta);
  Printf.printf "%10f\n" (height b theta);;
