A sinusoid or sine wave is a mathematical function of the f
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →A sinusoid or sine wave is a mathematical function of the form?(?) = ? sin(2??? + ?0) + ?0,with four parameters:? denotes the amplitude of the sine wave (default value: 1).? denotes the frequency of the sine wave in Hz (default value: 1/2?).?0 denotes the amount of phase (horizontal) shift of the sine wave (default value: 0).?0 denotes the y-offset or vertical shift of the sine wave (default value: 0).Create a class called Sinusoid with four double data fields representing the four parameters. Additionally, create the following:No-argument constructor Sinusoid() that creates a sinusoid with the four default parameter values.Constructor Sinusoid(double newAmplitude, double newFreq, double newPhase, double newYOffset) that creates a sinusoid with the user-specified parameter values.Method double evalAt(double t) that evaluates the y value of the sinusoid at time t.Method double[] evalAt(double[] tArray) that evaluates the y values of the sinusoids at thetimes in array tArray.Method void printFunction() that prints the functional form of the sinusoid to the console with2 decimal places for each parameter, e.g. y(t) = 2.00sin(6.28t + 0.50) + 0.10 for the sinusoid with amplitude 2, frequency 1, phase 0.5, and y-offset 0.1.Submit your source code in a file named Sinusoid.java! Do not include a main() method in your submission!
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds