Problem:Express the vector PQ in standard form and find its length where: |
> P := [5,7]: Q := [6,8]:
|
Solution:
The coordinates of the vector PQ are given by the coordinates of Q-P. Hence, |
> PQ := evalm(Q-P);
PQ := [1, 1]
Its lenth is given by the square root of the sum of the squares of the entries. |
> len := v -> sqrt(dotprod(v,v)):
> lenth_of_PQ := len(PQ);
1/2 lenth_of_PQ := 2