/**
 * 
 * Copyright 2010 Paul Scherrer Institute. All rights reserved.
 * 
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This code 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 Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this code. If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package ch.psi.plot.xy.generator;

/**
 * Generator to generate sinus wave
 * @author ebner
 *
 */
public class Sinus implements XYGeneratorFunction{
	
	private final double frequency;
	
	/**
	 * Constructor - Sinus generator
	 * @param frequency	Frequency of Sinus wave
	 */
	public Sinus(double frequency){
		this.frequency = frequency;
	}

	@Override
	public double generate(double x) {
		return Math.sin(frequency*x);
	}

}
