Computing: Free Pascal Programming

Programming Home   Home   Contact

Graphical vector addition and subtraction (Vectors).


Description: Generation of geometry exercises concerning the addition and subtraction of vectors. The exercises have to be resolved graphically, i.e. the user has to draw the different vectors and determine the resultant vector based on the drawing. The number of vectors may be chosen as 2, 3 or 4. As an (unselectable) option, the calculation of the resultant vector's magnitude and angle may be included for evaluation. Please note, that the program awaits all angles as positive values in degrees.
Help concerning the program usage and a brief description of how to add vectors graphically is included.

Improvement: Adding an "undo" function to stepwise undo the drawings already done.

Free Pascal features: Usage of canvas for line drawings. Addition of arrowheads to lines (classical Pascal procedure). Usage of the MouseDown event to get the x- and y-position of a mouse-click on a control. Control properties modification depending on actual situation.

Screenshot:

Graphical addition of 4 vectors