Programming:
Assignment #11 is an exercise on computing with arrays.
Arrays are often used to represent points in a multi-dimensional space.
For example,
A[] = {a1, a2, ... , aN}
represents a point in the N-dimensional space.
Specifically, your program (and related functions)
needs to be able to do the following:
- A function for point arithmetics:
For example,
for the two multi-dimensional points A and B,
C = A - B is interpreted as
C[i] = A[i] - B[i], for every element i.
- A function for point properties:
For example,
the distance from origin to point A can be calculated
by the formula: dA = sqrt(a1 ** 2 + a2 ** 2 + .... + aN ** 2),
where x ** y means x raise to the y-th power.
- Use these functions to
calculate the distance of a path linking
several points.
Non-functional requirement:
You should use multiple functions whenever appropriate.