Basic HTML version of Foils prepared 13 July 98

Foil 29 Height and Displacement (cont'd)

From Java Academy II:Advanced Java NPAC/ECS Java Academy -- February to April 98. by Tom Scavo

The java.lang.Math Class
Now translate these equations to Java syntax: double PI = Math.PI; // for brevity d_double = b*Math.cos( PI - alpha ); h_double = b*Math.sin( PI - alpha ); // convert double values to int: d = ( int ) Math.round( d_double ); h = ( int ) Math.round( h_double );
Note: All methods and variables of the Math class are static and must be qualified



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998