Predict the Motion
Time Limit: 5 Seconds Memory Limit: 32768 KB
Consider an electric field (E) that is uniform in both magnitude and direction,
a charged particle (with quantity q) moving it experiences an electric force
equal to q*E.
When the particle is moving with a velocity (V) in an uniform magnetic field
B, the magnetic force on it follows the equation Fm=q*VB.
The following graphs demonstrate these two cases.
Motion in electric field
Motion in magnetic field
With both cases above, one can easily predict the motion of the particle according
to Newton's law. Curious as you are, you also willing to know the track of the
particle moving in a space fill uniformly with both electric field and magnetic
field.
To begin with, it would be easier to place E, B and initial velocity V perpendicular
to each other. Let's select a plane perpendicular to the magnetic field, the
direction of E, B, V is downwards, inwards and rightwards, respectively, the
initial position of the particle is (0, 0). See the graph bellow.
Given the variables, and time t, your task now is to calculate the exact position of the particle after time t.
Input
This problem contains multiple test cases. Each case begins with a line of 6
real numbers q, m, E, B, V, and t. Note that, due to the high velocity of the
particle, we often care a time span no longer than 1e-6s, and the gravity of
earth is negligeable.
The total test case will not exceed 10.
Output
For each case, first print "Case #I:" where I is the case number starting form 1, the next line contains x and y coordinates, separate with a space. The format is [-]x.xxxe+xx. Note that printf("%.3e %.3e\n",x, y) generates this format in g++ compiler. Print a blank line after each test case.
Sample Input
6e-6 2e-13 3e3 0.01 3e6 1e-6 -1e-6 1e-13 1e4 0.5 9e4 1e-6
Sample Output
Case #1: 2.960e+00 4.020e-01 Case #2: 6.575e-03 -1.003e-02Submit
Source: ZOJ Monthly, April 2003