Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by vasco on 24/10/2014.
- */
- public class Golf {
- private double amplitude = 1, frequentie = 1;
- public double getYwaarde(double x){
- double y;
- y = amplitude * Math.sinh(frequentie*x);
- return y;
- }
- public String toString(){
- String output = String.format("y = %f sin( %f x )", amplitude, frequentie);
- if (this.amplitude == 1) {
- output = String.format("y = sin(%.1f x)", frequentie);
- }
- else if (this.frequentie == 1){
- output = String.format("y = %.1f sin(x)", amplitude);
- }
- else {
- output = String.format("y = %.1f sin( %.1f x )", amplitude, frequentie);
- }
- return output;
- }
- public void setAmplitude(double amplitude) {
- this.amplitude = amplitude;
- }
- public void setFrequentie(double frequentie) {
- this.frequentie = frequentie;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement