4
* 2003-April-28 Jason Rohrer
9
#ifndef COS_EXPRESSION_INCLUDED
10
#define COS_EXPRESSION_INCLUDED
12
#include "Expression.h"
13
#include "UnaryOperationExpression.h"
18
* Expression implementation of a unary cos operation.
20
* @author Jason Rohrer
22
class CosExpression : public UnaryOperationExpression {
27
* Constructs a unary cos operation expression.
29
* Argument is destroyed when the class is destroyed.
31
* @param inArgument the argument.
33
CosExpression( Expression *inArgument );
37
* A static version of getID().
39
static long staticGetID();
42
// implements the Expression interface
43
virtual double evaluate();
46
virtual Expression *copy();
56
long CosExpression::mID = 11;
60
inline CosExpression::CosExpression( Expression *inArgument )
61
: UnaryOperationExpression( inArgument ) {
67
inline double CosExpression::evaluate() {
68
return cos( mArgument->evaluate() );
73
inline long CosExpression::getID() {
79
inline long CosExpression::staticGetID() {
85
inline void CosExpression::print() {
94
inline Expression *CosExpression::copy() {
96
new CosExpression( mArgument->copy() );