Testing applet ScalarApplet

This applet graphically demonstrates the value of the scalar product of two vectors. It's still in prototype, so it's a bit rough round the edges. (To execute the applet,it will be necessary to set up Java security, as described in security setup.)

To use it, draw one vector using a left mouse drag, and another using a left drag while pressing the shift key. You can move the vector end-points by a left-drag or a shift and left-drag.

You can move the whole co-ordinate system around using right-drag, and you can zoom in and out using the mouse wheel.

The value of the scalar product of the two vectors $a$ (red) and $b$ (green) inclined at an angle $\theta$ is equal to $$ \hat{a} \cdot \hat{b} = a b \cos \theta $$

Since this is dimensionally the product of two lengths, its value is the area of a rectangle. This is shown as the yellow rectangle, one of whose sides is the projection of one vector on to the other ($a \cos \theta$), and the other one of whose sides in the length of the other vector ($b$).

The applet shows that rectangle partitioned by the dashed construction line that is normal to $b$. The two partitions are equal in size to the two rectangles to the left of the $y$ axis. If $\alpha$ is the slope of $\hat{a}$ and $\beta$ is the slope of $\hat{b}$ so that $\theta = \alpha - \beta$, these rectangles demonstrate:

$$ a b \cos \theta = a b \cos (\alpha-\beta) = a \cos \alpha \times b \cos \beta + a \sin \alpha \times b \sin \beta $$

(I'll change the colours to show this more convincingly in a later version.)

The source for this applet is here.