/* Title: /* Title: Vectors.h Author: Xiaoyang Yu Revised: 22-NOV-2002 Module Interface Specification: INTERFACE Vectors; TYPE vector; CONST zero: vector; PROCEDURE getvec(x,y: float): vector; PROCEDURE xval(v: vector): float; PROCEDURE yval(v: vector): float; PROCEDURE add(u,v: vector): vector; PROCEDURE mul(r: float; v: vector): vector; END Vectors. */ /* macro definition */ #define zero getvec(0,0) /* type definition */ typedef struct rec *vector; /* return the pointer of vector ( x, y ) */ extern vector getvec(float x, float y); /* return xval of vector v */ extern float xval(vector v); /* return yval of vector v */ extern float yval(vector v); /* add vector u and vector v */ extern vector add(vector u, vector v); /* multiple r and vector v */ extern vector mul(float r, vector v); /* show linklist:test only,delete later */ extern void showlist(); /* the end of vectors.h */