Re: Math

new topic     » goto parent     » topic index » view thread      » older message » newer message

A sin/cos function would give you a regular wave, but a polynomial would =
give you a curve like a road or bent paper-clip. =20

For example:

for x =3D from_loc to to_loc do
  y =3D sin(x*(z/(2*PI)))
  pix_y[x]=3Dy
end for

or

for x =3D from_loc to to_loc do
  y =3D 0
  for ctr =3D z to 1 by -1 do
    y =3D y + power(x,z) + some_constant
  end for
  y =3D y + some_other_constant
  pix_y[x]=3Dy
end for

HTH,
Michael J. Sabal

>>> keroltarr at HOTMAIL.COM 03/09/00 03:50PM >>>
Hello,

My higher math is a little rusty. Can anyone help me
out here. I need a formula for a wavy line. example:
as x increases steadily from 0 to 1 y goes up and down
z number of times.

^
|   _     /
|  / \   / Z =3D 2
Y| /   \_/
|/
+----------+->
0    X     1

This is slightly Euphoria related. The formula is
for a raytracing program I am using to generate
graphics for a game I and others are writing in
Euphoria. I can't seem do it the longer boolean
way in POV-Ray because it doesn't seem to like
things like <,>,=3D,<=3D,>=3D in a numeric expression.
Maybe I'm doing something wrong. Even so I'd like
to know how to do it with a formula.

TIA,
Lewis Townsend
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu