Hey, to continue my original question posted today (here's the original question:
"Hey, I was wondering how do you change the amplitude and the amount of cycles in a Dual Sine Graph. The Dual Sine Graph code is:
// Graph the dual sine graph
// Declare variables and constant
const int SIZE = 41;
double xData[SIZE];
double yData[SIZE];
double zData[SIZE][SIZE];
// Use a for loop to go through each array point
// and store in a number that results from the equation
for (int i = 0; i < 41; i++)
{
xData[i] = (i - 20.0)/20.0 * PI;
yData[i] = (i - 20.0)/20.0 * PI;
}
// Use two for loops to go through each matrix point of zData
// and store in the results from an equation
for (i = 0; i < 41; i++)
{
for (int j = 0; j < 41; j++)
{
zData[j][i] = sin(xData[i])*cos(yData[j]);
}
}
// Convert the native C++ double arrays to NI data types for visualization.
CNiReal64Vector xVector(SIZE, xData);
CNiReal64Vector yVector(SIZE, yData);
CNiReal64Matrix zMatrix(SIZE, SIZE, *zData);
// Plot the data
m_c3DGraph.Plot3DSurface(xVector, yVector, zMatrix);
I am wondering in which part of the code can you change the amplitude and how do you change the amplitude. I am also wondering in which part of the graph can you change the period of the graph and the amount of cycles. For example, if the user wants the graph of amplitude 5, the period 10, and 5 iterations of the graph, how do I write that in code? Thanks."
)
================
To continue, how do I graph a continuous 2D Sine graph. I know that this code creates a regular sine graph:
// Generate the interval wave vector
CNiMath::SineWave(m_wave, 100, 1);
// Graph the first sine wave
m_cGraph.Plots.Item(1).PlotY(m_wave);
If the user decid
es to graph, let's say, 10 iterations of the sine graph, how do I write the code for it?