home *** CD-ROM | disk | FTP | other *** search
- { Copyright (C) 1988 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }
-
- program DeltaHyperbolicAngle (output) ;
-
- { DelHAng - Compute exact and approximate number of }
- { iterations required to drive hyperbolic cosine }
- { coordinate to display limit. }
-
- function cosh ( x : single ) : single ;
- begin
- cosh := (exp(x) + exp(-x))/2.0
- end ;
-
- var
- isr,r : integer ; { shift parameter and radius }
- dx,coshdx,sinhdx : single ; { step angle and functions }
- coshx,sinhx : single ; { coordinate angle functions }
- ndx,ndxe : integer ; { number of coordinate rotations }
-
- begin
- for isr := 0 to 10 do begin
- r := 1 shl isr ;
- dx := 2.0*sqrt(1.0/r) ;
- coshdx := cosh(dx) ;
- sinhdx := sqrt(sqr(coshdx) - 1.0) ;
- coshx := 1.0 ;
- sinhx := 0.0 ;
- ndx := 0 ;
- { compute ndx }
- while r * coshx <= 16384 do begin
- coshx := coshx * coshdx + sinhx * sinhdx ;
- sinhx := sqrt(sqr(coshx) - 1.0) ;
- Inc(ndx)
- end ;
- { estimate ndx }
- ndxe := Trunc(ln(32768/r)/ln(coshdx+dx)) ;
- writeln (output,' ',r:5,' ',dx:10:5,' ',ndx:4,' ',ndxe:4)
- end
- end.
-
- { Copyright (C) 1988 Adam Fritz, 133 Main St., Afton, N.Y. 13730 }