Graph of a parametric curve on an angle?

In summary, the conversation discusses the problem of finding an equation for a graph on any angle, specifically a sin curve, in order to make the "flight paths" of ships in a two dimensional game more interesting. It is suggested to use a linear transformation with a rotation matrix to achieve this. The resulting parametric equations for the rotated sin curve are provided as (x=t*cos(θ)-sin(t)*sin(θ), y=sin(t)*cos(θ)+t*sin(θ)). The original poster expresses gratitude for the solution.
  • #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!
 
Physics news on Phys.org
  • #2
You can do any linear transformation with its matrix. Here's a rotation.

Let your original curve (x,y) b given as parametric equations x=f(t), y=g(t).

To rotate by an angle θ, map (x,y) to (x.cos(θ) - y.sin(θ), y.cos(θ) + x.sin(θ)).

The mappings in order are t --> (f(t),g(t)) --> (f(t).cos(θ) - g(t).sin(θ), g(t).cos(θ) + f(t).sin(θ)).

Putting it together, here is your sin curve, time parameter t, rotated by angle θ:
[tex]
\begin{array}{rcl}
x &=& t \cos ( \theta ) -\sin(t) \sin( \theta ) \\
y &=& \sin(t) \cos( \theta ) + t \sin( \theta )
\end{array}
[/tex]​
 
Last edited:
  • #3
Oh wow, thanks! This is exactly what I was looking for :p
 

1. What is a parametric curve on an angle?

A parametric curve on an angle is a way of representing a curve in two-dimensional space using a set of parametric equations. These equations describe how the x and y coordinates of a point on the curve change as a parameter, usually denoted by t, varies.

2. How is a parametric curve on an angle different from a regular graph?

A regular graph plots a single variable, usually y, against a single independent variable, usually x. A parametric curve on an angle, on the other hand, uses two separate equations to plot the x and y coordinates of a point on the curve. This allows for more complex and non-linear curves to be represented.

3. What is the purpose of using parametric equations to graph a curve on an angle?

Parametric equations allow for more flexibility and precision in graphing curves on an angle. They can represent curves that cannot be easily expressed using a single equation, and also allow for the use of trigonometric functions to create curves with varying slopes and angles.

4. How do you determine the direction of a parametric curve on an angle?

The direction of a parametric curve on an angle can be determined by examining the values of the parameter t. As t increases, the curve will move in the direction of the slope of the curve at that point. Additionally, the orientation of the curve can be determined by the equations used to define it.

5. Can a parametric curve on an angle intersect itself?

Yes, a parametric curve on an angle can intersect itself. This can happen when the equations used to define the curve create a closed loop, causing the curve to cross over itself at certain points. This is a unique feature of parametric curves and cannot be represented using a single equation.

Similar threads

Replies
4
Views
1K
Replies
3
Views
1K
Replies
2
Views
2K
  • Calculus
Replies
3
Views
970
  • Calculus
Replies
29
Views
690
  • Calculus
Replies
11
Views
3K
Replies
3
Views
1K
Replies
2
Views
956
Replies
4
Views
1K
  • Calculus
Replies
1
Views
1K
Back
Top