Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Operations on Vectors [4/13]

Generally speaking, all vectors have a magnitude and direction. Magnitude is the length of the vector. Direction describes where the vector is pointing to. There is, however, one important exception.

A null-vector doesn't have a direction. The length of a null-vector equals 0, and it's coordinate components are also equal to 0.

The getter .is0 from type vector2D returns true when a vector is a null-vector.

The getter .is0 from type vector2D is a pure function.

Loading...