Geometry: Assigments


Required

1 - Get the library libgeom.a . Save the file geom.tgz , decompress it with gunzip and use tar to create the directory geom in "./i3d/base/" . Compile and install the library.

2 - Using the library, implement the program vexpr for vector expressions. The operands are 3D vectors in the following format: x y z. The set of operators should include, at least, vetor addition, multiplication by a scalar, inner product, cross product, and test of vector equality. The program should read the first operand from the standard input and the second from the command line. The operations should be specified by name and given as parameters in the command line (e.g. sum, scale ). The result should be sent to the standard output.

Example: echo 1 3 0.4 | vexpr sum 2 1 1
3 4 1.4

3 - Using the gp and geom libraries, implement an interactive program program to transform and display polygonal lines. It should implement the following transformations: translation, rotations, and scale.


Optional

4 - Extend the library implementing the following functions:

- Linear interpolation of two vectors.

- Normal projection of a vector (u) along another vector (v).

- Tangential projection of a vector (u) along another vector (v)

- Sum of the components of a vector.

- Unit vector perpendicular to a given vector.

- Normal vector of the plane defined by three points p1, p2 and p3.

- The matrix of an orthogonal transformation that maps the unit vector u to the unit vector v.

- Puts the elements of a 4x4 array into a matrix structure.

- Compute 4x4 rotation matrix about an arbitrary axis

- Compute the inverse of a 4x4 matrix.