#ifndef __VEC3F__
#define __VEC3F__

#include <stdlib.h>

#define DEG_TO_RAD 0.0174532925f
#define RAD_TO_DEG 57.2957795f

class Vec3f
{
public:

	Vec3f(float x = 0, float y = 0, float z = 0);
	Vec3f(Vec3f* from, Vec3f* to);

	virtual ~Vec3f();

	Vec3f &operator = (const Vec3f& other);

	void add( Vec3f other );
	void sub( Vec3f other );
	void scale( float factor);

	float length();
	float lengthSq();

	float sqDistanceTo(Vec3f* to);

	void rotateX( float angle );
	void rotateY( float angle );
	void rotateZ( float angle );

	void rotateDegX( float angleDeg );
	void rotateDegY( float angleDeg );
	void rotateDegZ( float angleDeg );

	void rotate(float angle, Vec3f* other);
	void rotateDeg(float angleDeg, Vec3f* other);

	void normalize();

	void crossToSelf(Vec3f* other);

	static float scalarProduct(Vec3f* first, Vec3f* second);
	static float angleBetween(Vec3f* first, Vec3f* second);
	static float angleBetweenDeg(Vec3f* first, Vec3f* second);

	float x;
	float y;
	float z;
};

#endif __VEC3F__