#ifndef _GEOMETRY_H_
#define _GEOMETRY_H_
/**
 * \file geometry.h
 * \brief Header for geomtery.c
 *
 *
 * \ingroup corefiles
 * \date Apr 20, 2009
 * \author Alexander Pimenov
 */

#ifdef __cplusplus
	extern "C" {
#endif



#include <stdint.h>

typedef struct vector2Ds16_tag {
	int16_t x;
	int16_t y;
} vector2Ds16;


typedef struct vector2Du16_tag {
	uint16_t x;
	uint16_t y;
} vector2Du16;

typedef struct vector2Dd_tag {
	double x;
	double y;
} vector2Dd;

typedef struct vector3D_tag {
	uint16_t x;
	uint16_t y;
	uint16_t z;
} vector3D;

typedef struct vector3Dd_tag {
	double x;
	double y;
	double z;
} vector3Dd;

#define CLIP_HAD_INTERSECTIONS (0)
#define CLIP_NO_INTERSECTIONS (-1)

int clipCohenSutherland ( int16_t x1, int16_t y1, int16_t x2, int16_t y2, vector2Ds16 *a, vector2Ds16 *b);
vector3Dd crossProduct(vector3Dd *a, vector3Dd *b);
double dotProduct(vector3Dd *a, vector3Dd *b);
void vectorPrint(vector3Dd *v);

vector3Dd vectorCreate(double x, double y, double z);

void vectorNormalize(vector3Dd *a);
void vectorHomogeniousNormalize(vector3Dd *a);

#ifdef __cplusplus
	} // 	extern "C"
#endif
#endif /* _GEOMETRY_H_ */
