- #1
Ownaginatious
- 38
- 0
I'm currently making a two dimensional game on my computer and I'm having a problem that pertains to parametric curves.
Currently I'm trying to figure out an equation for a graph on any angle (say a sin curve). The reason for this is to make the "flight paths" of the ships in the game more interesting. Right now they basically fly towards a target from any angle.
So far, I've figured out that for a normal sin curve along the x-axis, the equation is (0 degrees):
x = t
y = sin(t)
And along the y-axis is (90 degrees):
x = sin(t)
y = t
Now what I'm trying to figure out is how to make the sin graph appear on any angle, say along a 45 degree angle.
Can anyone help me figure out an equation for that? I know this is probably simple, but I'm only a first year engineering student and haven't spent much time on parametric curves :p.
Thanks!
Currently I'm trying to figure out an equation for a graph on any angle (say a sin curve). The reason for this is to make the "flight paths" of the ships in the game more interesting. Right now they basically fly towards a target from any angle.
So far, I've figured out that for a normal sin curve along the x-axis, the equation is (0 degrees):
x = t
y = sin(t)
And along the y-axis is (90 degrees):
x = sin(t)
y = t
Now what I'm trying to figure out is how to make the sin graph appear on any angle, say along a 45 degree angle.
Can anyone help me figure out an equation for that? I know this is probably simple, but I'm only a first year engineering student and haven't spent much time on parametric curves :p.
Thanks!