Math Is Fun Forum

You are not logged in.

#1 2006-01-20 00:47:50

Registered: 2006-01-19
Posts: 4



I am trying to generate a set of sine curve values that range from 0 to 1 to 0

I am using seed values of 1 to 100

I have got close with the following formula but it's not correct

If i ranges from 0 to 100



gets me from 0 to
0.998045198613548 to

how do I get from
0 to
1 to

using i



#2 2006-01-20 04:26:22

Registered: 2005-08-04
Posts: 394

Re: Sines

Plain old sin(x) ranges from 1 to -1 on the y axis. You want half of that, so start with y= (1/2)sin(x). Now just add 1/2 to shift it up:

y= (1/2)sin(x) + 1/2

Last edited by ryos (2006-01-20 04:27:11)

El que pega primero pega dos veces.


#3 2006-01-20 09:42:26

Registered: 2005-11-24
Posts: 457

Re: Sines

What frequency did you want?

Just remeber that they use the sin function to model waves. 

y = Asin(ωt + Φ)

Your not really modeling a wave but you can use this function to generate any sin wave that you wish.

A is the amplitude, the maximum displacement positive and negative from the x axis.

Φ is just a phase shift,  which you can add or subtract based on what height you wish to begin.  Otherwise your wave will always start at zero.

ωt is the frequency, if you just make this x and are using degrees you will be at the same point every 360 units.  You can divide or multiply x by a constant to vary this as much as you want.

If you divide the frequency by an increasing factor such as another function of x then you will produce a dampening effect which more closely models a true wave.

Learn to play around with all of those factors and you can create a limitless number of different waves.


#4 2006-01-20 10:18:00

Registered: 2005-12-04
Posts: 3,791

Re: Sines

y = Asin(ωt + Φ)

There is a fourth constant you can use:

y = Asin(ωt + Φ) + C

It doens't mean anything when talking about scientific waves (such as modeling sound), but it can be used to help make the sin graph go through a certain point.

Last edited by Ricky (2006-01-20 10:18:56)



#5 2006-01-20 10:24:32

Registered: 2005-11-24
Posts: 457

Re: Sines

Yeah,  C would just replace the x axis.  In other words whenever y would equal zero it will now equal C.


Board footer

Powered by FluxBB