## 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,