View Javadoc
1 package edu.psu.geovista.app.spreadsheet.functions; 2 3 import edu.psu.geovista.app.spreadsheet.formula.Node; 4 import edu.psu.geovista.app.spreadsheet.exception.ParserException; 5 import edu.psu.geovista.app.spreadsheet.exception.NoReferenceException; 6 import edu.psu.geovista.app.spreadsheet.util.Debug; 7 8 /* 9 * Description: 10 * <code>SIN</code><br> 11 * usage: <code>=SIN(parameter)</code><br> 12 * accepts only one literal or address<br> 13 * returns the sine of the specified parameter (in radians)<br> 14 * example: <code>=SIN(45)</code> returns <code>0.8509035</code> 15 * Date: Mar 25, 2003 16 * Time: 10:39:53 AM 17 * @author Jin Chen 18 */ 19 20 21 public class FunctionSin extends Function { 22 23 public Number evaluate( Node node) throws ParserException,NoReferenceException { 24 Debug.showNode(node," FunctionSin() show node "+node); 25 return new Float(Math.sin(getSingleParameter( node))); 26 } 27 28 29 public String getUsage() { 30 return "SIN(value)"; 31 } 32 33 public String getDescription() { 34 return "Returns the sine of an angle."; 35 } 36 } 37 38

This page was automatically generated by Maven