Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

WPCG::WP_Math Class Reference

#include <WP_Math.h>

List of all members.

Public Methods

 ~WP_Math ()
scalar degreeToRad (int angle) const
scalar fDegreeToRad (scalar angle) const
int radToDegree (scalar rad) const
scalar fRadToDegree (scalar rad) const
scalar round (scalar s) const
scalar getSin (int i) const
scalar getCos (int i) const

Static Public Methods

WP_Math * getInstance ()


Detailed Description

a singleton class holding sin and cos values for a quick lookup of angles in degrees and for conversions from degrees to radians and vice versa
Author:
Copyright (C) 2001 W.P. van Paassen peter@paassen.tmfweb.nl
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


Constructor & Destructor Documentation

WPCG::WP_Math::~WP_Math   [inline]
 


Member Function Documentation

scalar WPCG::WP_Math::degreeToRad int    angle const [inline]
 

this function converts an angle in degrees to an angle in radians

Parameters:
angle  the angle in degrees
Returns:
the angle in radians

scalar WPCG::WP_Math::fDegreeToRad scalar    angle const [inline]
 

this function converts an angle in degrees to an angle in radians

Parameters:
angle  the angle in degrees
Returns:
the angle in radians

scalar WPCG::WP_Math::fRadToDegree scalar    rad const [inline]
 

this functions converts an angle in radians to an angle in degrees

Parameters:
rad  the angle in radians
Returns:
the angle in degrees

scalar WPCG::WP_Math::getCos int    i const [inline]
 

this function returns the cos value of an angle in degrees

Parameters:
i  the angle in degrees
Returns:
the cos value of the angle

WP_Math* WPCG::WP_Math::getInstance   [inline, static]
 

this function returns a pointer to the only instance of this class (singleton)

Returns:
a pointer to the only instance of this class

scalar WPCG::WP_Math::getSin int    i const [inline]
 

this function returns the sin value of an angle in degrees

Parameters:
i  the angle in degrees
Returns:
the sin value of the angle

int WPCG::WP_Math::radToDegree scalar    rad const [inline]
 

this functions converts an angle in radians to an angle in degrees

Parameters:
rad  the angle in radians
Returns:
the angle in degrees

scalar WPCG::WP_Math::round scalar    s const [inline]
 

this function rounds of scalars to whole numbers. for example 1.49 is rounded to 1.0 and 1.50 is rounded to 2.0

Parameters:
s  the to be rounded scalar
Returns:
the rounded scalar


The documentation for this class was generated from the following files:
Generated on Tue Jan 28 20:26:40 2003 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002