CHAPTER 26

COLLECTION OF PROGRAMS

In this chapter, we will see both applications and applets. We will try to cover problems from different walks of life.

26.1 Projectile

When we see a fielder standing on boundary line, throwing the ball straight into the gloves of the wicket keeper, we think that he is a genius. Well, he may or may not be, but one thing is sure. He has done his college physics seriously. A projectile starting at an angle of 45 degrees travels farthest, before hitting the ground.

Let us develop an applet to show the trajectory of a projectile.

Problem: Write an applet to show the trajectory of a projectile.

Solution: Let us assume the following:

When a projectile starts, it has velocities both in horizontal and vertical direction. ...

Get Programming with Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.