## Triangle Law & Parallelogram Law Applet

This was my first real programming assignment. It is a Java applet that demonstrates a maths concept. My entire class had to create one such applet each and the end product can be viewed at this Leaving Cert. Higher Level maths – revision & study website.

It’s not a very imaginative demonstration, but it just about does the job.

### How to use this applet:

There are three modes to this applet.
There is the Triangle Law Mode, the Parallelogram Law Mode and the Parallelogram Law Game Mode.
Each of these modes can be selected by pressing the relevant button:

• Triangle – Triangle Law Mode
• Parallelogram – Parallelogram Law Mode
• Game – Parallelogram Law Game Mode

Once you have selected a mode, all you have to do is draw vectors in the outlined box, by clicking first at the start of the vector and then the end.

In the Parallelogram Law and Parallelogram Law Game, you can only draw two vectors. In the Triangle Law, you can draw as many vectors as you like.

Finally in the Parallelogram Law and the Triangle Law, all you do then is press Go and the applet will draw the resultant or equivalent vector, repectively. In the Game, you guess where the end of the resultant vector is by clicking, if you want to know the answer, after you’ve made at least one guess, press Go.

That’s it. Enjoy it, if you can!

### Notes on the maths used in the applet:

#### Triangle Law:

The Triangle Law states that,

ab + bc = ac

This means that the vector ab (ie. the vector starting from point a and finishing and point b) and the vector bc, when added together have an equivalent vector ac.

Take for example a person travelling on a forest path. They can:

1. Take the long and winding path from where they start to where they finish, or
2. Walk directly, as the crow flies, from where they start to their destination.

Either way the person, still leaves from a and finishes at c. Thus the two ways of doing it are equivalent, the same goes for vectors.

#### Parallelogram Law:

The Parallelogram Law states that,

ab + ad = ac

This means that the vector ab (ie. the vector starting from point a and finishing and point b) and the vector ad, when added together have a resultant vector ac.
Notice that in the Parallelogram Law, the vectors start from the same place, point a.

A practical example of the Parallelogram Law in effect is that of a slingshot. A slingshot is aimed by pulling back the cup of it, and aiming it at a specific target. If you look at the shape of the elastic whilst doing this, you will see that they shape two lines starting from the same position, ie. the cup. The direction in which the cup goes, ie. the resultant vector, after you let go, depends on the two bits of elastic. How far you pull them back, at one angle they are, etc. This is the Parallelogram Law in action.

The resultant vector depends on the two other vectors that create it. They are two different forces, and the resultant vector is a compromise between these two forces.