How to calculate an angle of a right triangle given opposite and hypotenuse in Pascal

1 Answer

0 votes
program RightTriangleAngle;

uses
  Math;  { for ArcSin and Pi }

var
  opposite, hypotenuse : Real;
  angle_sin, right_triangle_angle : Real;

begin
  opposite := 2.5;
  hypotenuse := 5.0;

  angle_sin := opposite / hypotenuse;
  right_triangle_angle := ArcSin(angle_sin) * 180 / Pi;

  WriteLn('Right Triangle Angle = ', right_triangle_angle:0:2);
end.



(*
run:

Right Triangle Angle = 30.00

*)

 



answered 22 hours ago by avibootz
...