Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

The type vector2D [5/11]

This program illustrates a vector with a line ended by a disc.

The getter .vecTo from type point2D is employed in this program to compute a difference between the center point and the mouse position.

The difference between two points is always a vector. Therefore, the getter .vecTo returns a vector. The vector v then stores this vector of differece between the center point and the mouse position.

Loading...