URGENT NEED THE ANSWER ASAP

Pages: 12
I know the tenth point to be where y = sin(pi) is what i have below:
0 * pi
0.1 * pi
0.2 * pi
0.3 * pi
0.4 * pi
0.5 * pi
0.6 * pi
0.7 * pi
0.8 * pi
0.9 * pi
1.0 * pi
1.1 * pi
1.2 * pi
1.3 * pi
1.4 * pi
1.5 * pi
1.6 * pi
1.7 * pi
1.8 * pi
1.9 * pi
2.0 * pi
these are too many points
i need every fifth point and have no idea what it is. I'm trying to make a graph but without the plots its impossible. Its a sin wave graph going up in 2's from 2 to 40(time). It needs to go through two cycles so when the time is 10,20,30 or 40 it means the graph is 0 but i obviously need the plots inbetween those numbers. please help
Last edited on
Okay, so what do you need to happen? You're not really being clear.
That looks awfully familiar. For newcomers to this question, here's the history:
http://cplusplus.com/forum/beginner/55281/

If y is meant to be zero when t=0, 10, 20, 30, 40, it suggests that the equation is:

y = sin (pi * t / 10);

For example, let's see what y equals when t is 0, 10,20,

t = 0: y = 0
t = 10: y = 0
t = 20: y = 0

To find other points that you can plot, just pick values of t.

could someone just show me the plot values? i'm trying to draw it on paper before i program it
finding the tenth point is too many points.so basically i need every fifth point


There are literally an infinite number of points. There is no "tenth point" or "every fifth point". There are an infinite number of points. If you don't understand that, don't worry. Someone short-changed you in math class, but presumably this is C++ class.

I think what you meant is that you want to get 5 values between t=0 and t=10 (which is where that sin wave you keep showing us crosses the horizontal line according to your clue above, " so when the time is 10,20,30 or 40 it means the graph is 0"), and 5 values between t=10 and t=20, and so on.
Last edited on
yes so could you help me find those five values between 0 and 10? i'll try find the rest myself
{{0., 0.},
{0.1, 0.309017},
{0.2, 0.587785},
{0.3, 0.809017},
{0.4, 0.951057},
{0.5, 1.},
{0.6, 0.951057},
{0.7, 0.809017},
{0.8, 0.587785},
{0.9, 0.309017},
{1., 1.22465*10^-16},
{1.1, -0.309017},
{1.2, -0.587785},
{1.3, -0.809017},
{1.4, -0.951057},
{1.5, -1.},
{1.6, -0.951057},
{1.7, -0.809017},
{1.8, -0.587785},
{1.9, -0.309017},
{2., -2.44929*10^-16}}


Just a single line of Mathematica code did the trick. (Table[{x, Sin[x*Pi]}, {x, 0, 2, .1}])

These are the values between 0 and 2π with jumps of 0.1π.
Last edited on
Why wouldn't you just increment t by 5?

 t += 5;


sorry i dont really understand these values. thats why i asked for something similar to my first comment (some number * pi). i dont think i can plot the values you gave on paper
Because that would leave only two values between 0 and 10.
needs to incremented by 2 - part of assignment so cant change it. i'm drawing a graph so i need more values than what t += 5 would give
so can i get values like ( some number * pi )?
The values Kyon gave you are perfect.

i dont think i can plot the values you gave on paper


Dude, seriously, you can. Let's look at one of them:

{0.1, 0.309017},

That point is at 0.1 on the horizontal line, and 0.309017 on the vertical line.
but the points in the horizontal line is t which as i said is going up in 2s from 2 to 40. so i cant use these values. i'm looking for the values on the vertical line.

thats why i just asked for the values for ( some number * pi ). i want to try figure this out for myself but i need a bit of help on this part.
Did you perhaps read my post above?

y = sin (pi * t / 10);

That is y = sin (some number * pi)
but does that give me the same values as i listed in my first post?
No, he's been wasting his time for two days just to mess with you.
alright so that gives me the numbers between 0 to 10. do i just change
y = sin (pi * t / 10); to y = sin (pi * t / 40); to get the values from 0 to 40?
If you do that, you'll screw all the values up. You have to let t take on more values. Rather than having it iterate over the range [0;10], it has to iterate over [0;40].
Pages: 12