#ifndef __SSADDITIONAL_HPP
#define __SSADDITIONAL_HPP

#include "ssMatrix.hpp"
#include "def.h"
#include <stdlib.h>

namespace SS
{
inline float degreeToRad(float degrees)				{ return degrees * (3.1415f / 180.0f);	}
inline int extractSign( float a )					{ return *((int *)&a) & 0x80000000; }
inline float randMinusHalfHalf( )					{ return (float)rand( ) / (float)(RAND_MAX / 2) - (float)1; }

extern float norm_inf( const Matrix3x3 &m );
extern float norm_1( const Matrix3x3 &m );
extern int extractSign( float a );
extern float randMinusHalfHalf( );
extern Vector3 randInBox( );
extern Vector3 randInBox( float edgeLength );
extern Vector3 randOnSphere();
extern Vector3 randOnSphere( float radius );
extern Vector3 randInSphere( );
extern Vector3 randInSphere( float radius );
extern Vector2 randInCircle( );
extern Vector3 perpendicular( const Vector3 &v );
};

#endif
