Graphing Question

gummby8

New member
Joined
Sep 22, 2014
Messages
15
Hello I am running into a bit of trouble with my programming

I have a bunch of particles that I want to follow a certain path from Y1 to Y35. The particles can appear anywhere between X -7 and X 7 , at Y 1 and then travel up the Y axis. I am trying to get all the particles to converge at a single point on the x and Y axis. Once the particles go beyond Y36 they disappear

I cant seem to get my finger on exactly how to calculate this. The variables I have to work with are

Current Y Coord = Y
Current X Coord = X
Origin X Coord = T

The curved lines are how I want the particles to travel in the end.


2zqa9zd.png


The best that I have come up with is
Y = Y
X = T + (Y * Y / 280)
But this does not achieve the desired results.


Any help would be greatly appreciated.

Thank you!
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    11 KB · Views: 2
What you are saying is confusing. You say "The particles can appear anywhere between X -7 and X 7 , at Y 1" (so anywhere on the line y= 1 from x= -7 to x= 7?) "and then travel up the Y axis". Do you actually mean that they move along x= 1 to x= 0 and then up x= 0 (the x- axis) or do you mean they travel along the curved path from \(\displaystyle (x_0, 1)\) to y= 35? If the latter, how is that arc defined? There are an infinite number of arcs that pass through \(\displaystyle (x_0, 1)\), for given \(\displaystyle x_0\), and (0, 35).
 
If I am understanding correctly, what you want is a series of points at an initial (x, y) position of (xj, T) and have those points travel in the positive y direction at the same speed and end up all at the same point (0, U), U = y35, some time later where everything disappears.

One of the easiest ways to do this is to write equations in terms of some other variable like time. So, at time zero the points are at (xj, T) and at time V (which you will have to decide on) where they are at (0, U). The easiest way to do this is to have them follow straight lines. That is

x = xj - (xj / V) t
y = T - ((T - U) / V) t

notice that you can add any function (one for x and one for y) to those as long as they were zero at the end points, thus

x = xj - (xj / V) t + t (t - V) f(t)
y = T - ((T - U) / V) t + t (t - V) g(t)

what would the resulting graphs be for t between 0 and V if
V = 1
xj = -7 + j, j = 1, 2, 3, ..., 14
f(t) = 0
g(t) = 1

Edit to add: If you would like to have fun having each point follow it own independent trajectory you could chose (in the example) 14 functions, one pair of (f(t), g(t)) for each point.
 
Last edited:
Top