2.4 General Math library

The classes and functions in the math library are:
class lg_vector
{
	friend class lg_point;
	protected:
		//whoa, this is some secret stuff...
		//look at the source code for the protected listing....
		
	public:
		lg_vector();
		void copy (lg_vector *v);
		void set (float ii, float jj, float kk);
		void get (float *ii, float *jj, float *kk);
		void set_bypoint (lg_point *src, lg_point *dest);
		void set_module (float mod);
		void unit ();
		void add (lg_vector *v);
		void subtract (lg_vector *v);
		void multiply (float n);
		void divide (float n);
		float module ();

		static float prod_int (lg_vector *v1, lg_vector *v2);
		static float cos_ang (lg_vector *v1, lg_vector *v2);
		void proj_vec (lg_vector *src, lg_vector *dest);
		void prod_vec (lg_vector *v1, lg_vector *v2);
};

class lg_point
{
	friend class lg_vector;
	protected:
		//whoa, this is some secret stuff...
		//look at the source code for the protected listing....
	public:
		lg_point();
	
		void copy (lg_point *p);
		void set (float xx, float yy, float zz);
		void get (float *xx, float *yy, float *zz);

		// overload
		void add (lg_vector *v);
		void subtract (lg_vector *v);
		void add (lg_vector *v, float alfa);
		void subtract (lg_vector *v, float alfa);
};

class lg_line
{
	protected:
		//whoa, this is some secret stuff...
		//look at the source code for the protected listing....
	public:
		lg_line();
	
		void copy (lg_line *l);

		// overload
		void set_point (float xx, float yy, float zz);
		void set_vector (float ii, float jj, float kk);
		void set_point (lg_point *p);
		void set_vector (lg_vector *v);

		void get_point (lg_point *p);
		void get_vector (lg_vector *v);
};

float dist_ptop (lg_point *p1, lg_point *p2);
If you don't know what this stuff means, please look them up in a Linear Algebra or Analytical Geometry book.

Back to Home