Task
Implement a Vector class (or a set of functions) that models a Physical Vector. The four basic operations and a pretty print function should be implemented.



The Vector may be initialized in any reasonable way.

 Start and end points, and direction
 Angular coefficient and value (length)


The four operations to be implemented are:

 Vector  +  Vector addition
 Vector  -  Vector subtraction
 Vector  *  scalar multiplication
 Vector  /  scalar division


MODULE Vector;
FROM FormatString IMPORT FormatString;
FROM RealStr IMPORT RealToStr;
FROM Terminal IMPORT WriteString,WriteLn,ReadChar;
 
TYPE Vector =
    RECORD
        x,y : REAL;
    END;
 
PROCEDURE Add(a,b : Vector) : Vector;
BEGIN
    RETURN Vector{a.x+b.x, a.y+b.y}
END Add;
 
PROCEDURE Sub(a,b : Vector) : Vector;
BEGIN
    RETURN Vector{a.x-b.x, a.y-b.y}
END Sub;
 
PROCEDURE Mul(v : Vector; r : REAL) : Vector;
BEGIN
    RETURN Vector{a.x*r, a.y*r}
END Mul;
 
PROCEDURE Div(v : Vector; r : REAL) : Vector;
BEGIN
    RETURN Vector{a.x/r, a.y/r}
END Div;
 
PROCEDURE Print(v : Vector);
VAR buf : ARRAY[0..64] OF CHAR;
BEGIN
    WriteString("<");
 
    RealToStr(v.x, buf);
    WriteString(buf);
    WriteString(", ");
 
    RealToStr(v.y, buf);
    WriteString(buf);
    WriteString(">")
END Print;
 
VAR a,b : Vector;
BEGIN
    a := Vector{5.0, 7.0};
    b := Vector{2.0, 3.0};
 
    Print(Add(a, b));
    WriteLn;
    Print(Sub(a, b));
    WriteLn;
    Print(Mul(a, 11.0));
    WriteLn;
    Print(Div(a, 2.0));
    WriteLn;
 
    ReadChar
END Vector.