/*---------------------------------------------------------------------------

    NN Math Library for DXG20

    Copyright (C) 2002, 2003 SEGA Corporation Creative Center Graphics Sect.
    All Rights Reserved.

    Module  : NN Math Library for DXG20
    File    : nnlmathxe.h
    Create  : 2003/06/05
    Modify  : 2003/06/05
    Modify  : 2003/07/14 Xbox,PC共通化向けの修正
    Version : 0.01.00
    Note    :

---------------------------------------------------------------------------*/
#ifndef __NNLMATHDXG20_H__
#define __NNLMATHDXG20_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#define	INVRANDMAX		(1.f / (Float)((Uint32)(RAND_MAX + 1)))
#define	nnRandom()		((Float)rand() * (INVRANDMAX))
#define	nnRandomSeed(n)	(srand((Uint32)(n)))

#define	nnAbs(n)		((Float)fabs((double)(n)))
#define	nnArcCos(n)		((Angle32)NNM_RADtoA32(acos((double)(n)) ))
#define	nnArcSin(n)		((Angle32)NNM_RADtoA32(asin((double)(n)) ))
#define	nnArcTan(n)		((Angle32)NNM_RADtoA32(atan((double)(n)) ))
#define	nnArcTan2(y,x)	((Angle32)NNM_RADtoA32(atan2((double)(y), (double)(x))))
Float	nnCos(Angle32 ang);
#define	nnExp(x)		((Float)exp((x)))
#define	nnFloor(n)		((Float)floor((double)(n)))
Float	nnFraction(Float n);
#define	nnHypot(x,y)	((Float)sqrt((double)((x) * (x) + (y) * (y))))
Float	nnInvertSqrt(Float n);
#define	nnLog(n)		((Float)log((double)(n)))
#define	nnLog10(n)		((Float)log10((double)(n)))
#define	nnPow(n1,n2)	((Float)pow((double)(n1), (double)(n2)))
Float	nnRoundOff(Float n);
Float	nnRoundUp(Float n);
Float	nnSin(Angle32 ang);
void	nnSinCos(Angle32 ang, Float *s, Float *c );
Float	nnSqrt(Float n);
#define	nnTan(ang)		((Float)tan(NNM_A32toRAD(ang)))

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __NNLMATHDXG20_H__ */

/* End of file */
