Maths - Trig Graphs

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
I was going well with this spell, I want to make it move in a cosine wave and I was wondering if this equation can be done in radians...

Code:
y = cos(x - 2)

Do I have to convert the 2 into something else first?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Well, in radians, 360 degrees becomes 2*PI.
So, if you want to convert to radians, multiply by PI then divide by 180.
Do the reverse to convert to degrees.

Now, you can use 2 there, but it will actually subtract about 115 degrees.

I guess I don't really know what you're asking....
 

Sim

Forum Administrator
Staff member
Reaction score
534
What will "x" be?

A real number between -1 and 1? 500?
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Ok so how would I normaly go about doing

Code:
y = cos(x - #)             radians

Because I know that if it was #pi it would effect the frequency, and if it wasn't in brackets it would be the y placement but i'm stuck on this, and I can't seem to figure out what exactly I need to do.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> I can't seem to figure out what exactly I need to do.

I don't know what you want it to do. :p

What is it that you want to happen that is different from a regular sine wave?
 

Sim

Forum Administrator
Staff member
Reaction score
534
It depends on what x is.

Show us your trigger.

BTW:

> I was wondering if this equation can be done in radians...

JASS:
native Cos      takes real radians returns real


radians :rolleyes:

Alternatively, CosBJ takes real degrees.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> It depends on what x is.

Eh?
It's not inverse, remember.

X can be any real number....

I don't really know what you want with the (x - z) part....
Are you two on a different level than I? :p
I'm kind of confused.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
I don't really know what you want with the (x - z) part....

It's x minus two.

All I really want to know is how the - 2 in brackets effects the wave, does it move it vertically or horizontally and if so by how much?
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
Trigonometry: Factors that affect how a Cos Curve look

On a simple 2D with x, y axis
Equation: y = ACos(Bx + C)

A - affects the maximum value of y (how high the graph will go)
B - determines how many "waves" will appear in a range of 360 deg of x
C - cause a horizontal shift. a positive number shifts the graph right

Note: Deg / Radians are just like inches to cm, its just conversion using a constant.

These are ancient stuffs for me, so correct me if I am wrong.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Yeah that looks right, and for C horizontal shift, for my equation
y = cos(x - 2)
How far am I supposed to shift it to the right?
Because this is in radians.
 

Sim

Forum Administrator
Staff member
Reaction score
534
> does it move it vertically or horizontally and if so by how much?

Horizontally.
 

Foresector

Member
Reaction score
16
Umm, I'm not too sure about that..

I thought Y=Cos(x-2) would make the graph shift downwards.. I might be wrong though :eek:

EDIT: Sorry its horizontal,
 

Chjoodge

New Member
Reaction score
14
B - determines how many "waves" will appear in a range of 360 deg of x
Yes, but inversely: there will be 1/B waves. Higher B results in less waves.

C - cause a horizontal shift. a positive number shifts the graph right
Inversly - left.

All I really want to know is how the - 2 in brackets effects the wave, does it move it vertically or horizontally and if so by how much?
If you ask how the -2 affects the given unit's movement, the effect of that -2 is that it will make the unit start its move on a different point of the wave. I guess this is not what you want.

If you could describe what you're aiming for, we could probably help you get the formula you need.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Ok pretend i'm not talking about warcraft, let's say i'm just talking about maths.

y = cos(x - 2)

What would this wave look like, I know it'd look like a cosine graph with an amplitude of 1, but where would you start to draw the wave, and how do you know how far along the graph would you move the wave. (x of graph is radians)
 

Chjoodge

New Member
Reaction score
14
You would move the wave 2 units to the right, "units" being radians in your case. See the attached image.
 

Attachments

  • ChoppaCos.png
    ChoppaCos.png
    7.8 KB · Views: 138

Chjoodge

New Member
Reaction score
14
Pi is 3,14, so '2' is in about two-thirds between zero and Pi, if that's what you mean.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top