// A class that represents the sine function as a mathematical // function object. // History: // // January 2007 -- Created by Doug Baldwin as part of a prototype // solution to a CSci 240 exercise. class SineFunction implements Function { // Return the value of sine(x) for a given x. x is measured // in radians. public double value( double x ) { return Math.sin( x ); } // Return a string representation of a sine function. public String toString() { return "sin(x)"; } }