# data[].attributes.body
It does not need to figure in the time step as it is only used to find the initial velocity you can assume t=0 at the end of the impulse.

# data[].attributes.body
Yes if programs crash under normal operation. However, there will be no deliberate effort to break code with invalid data etc.

# data[].attributes.body
odd motion is likely to be a issue of not rotating the damping vector correctly. Collision is another and that totally depends on how you are doing the collision detection. I assigned a size to the balls and then checked when the radius intersected.

# data[].attributes.body
I have most of my conservation of momentum code finished however I have noticed that if I put the balls in a position where they should not (theoretically) collide. however when this happens I see a small movement in the X axis or Y axis which goes in the opposite direction of the force direction. Is this normal or do I have something very wrong that I should be looking for?

# data[].attributes.body
The force vector define the angle so it taken care of by that so can be whatever your want

# data[].attributes.body
Make sure the acceleration is negative in v = u + at
so should be vnew = vold - g*detaT

Note the negative sign

# data[].attributes.body
I get an infinite loop when I do trajectory in 3d. everything looks normal but just as my object is about to hit the floor it flies upward and never comes back down. any ideas

# data[].attributes.body
Will we gain or lose marks based on quality of code and will we lose marks if it is possible to crash the program with incorrect data input eg. expecting an int but inputting a string (if we are not hard coding the tests)

# data[].attributes.body
Hi sir, I'm confused about part b. You said we need to use the 3d library for this question but the brief only asked us to do the velocity vector method for the 2d library. Should I create another method for the 3d library? If I do, how would I calculate the z component. I know the X component is cos(angle) and the y component is sin(angle) but I'm quite confused on what to do with the z component.

# data[].attributes.body
I don't understand, if you are only going to use the impulse equation at the beginning and not in the timeStep loop, how would you find the initial Velocity when you are not given the Velocity? What I did was assumed that the object is at rest before the impulse is applied, and in the timeStep loop, find the Velocity using the impulse equation until the time has reached the total time the impulse was applied and after continue the loop calculating the v using v= u+at;

# data[].attributes.body
Thanks phil. It appears to be working now (although I did notice that rotating by 360 does not give me a vector identical to the original). Also am I correct in thinking that the magnitude of the origin vector should be equal to the origin of the rotated vector such as in this equation below where a is the origin vector and b is the rotated vector?

|a| = |b|

# data[].attributes.body
need a bit information here in order to help. What exactly is the problem you are having?

# data[].attributes.body
This is just the normalised vector (divide each component by the magnitude)and not the normal to a plane.

# data[].attributes.body
Yes rotate anticlockwise from the x-axis - vec below is the original vector

rotatedVector.x = vec.x*cos(angle) - vec.y*sin(angle)
rotatedVector.y = vec.x*sin(angle) + vec.y*cosf(angle)

# data[].attributes.body
hello phil, i'm able to print out the velocity vectors of on question A however i'm having a bit of trouble printing out the position vectors during each time step.

# data[].attributes.body
I am currently trying to get vector rotations completed however I am having problems when checking the results. I have been testing my function against online vector rotation calculators but my results differ from the ones the calculators give me.

Am I correct in thinking that the equation for rotating a vector anticlockwise is:
x2 = cos(A * x1) - sin(A * y1)
y2 = sin(A * x1) + cos(A * y1)
wherein x1 and y1 are the original vector, x2 and y2 are the new vector and A is angle

# data[].attributes.body
Is this to do with the way a plane is facing? Or is this a normalised version of a unit vector.

# data[].attributes.body
Yes that would be fine. You can have it as a hard coded input

# data[].attributes.body
To make things simple you can treat this as a deceleration of 0.1ms/s that always acts opposite to the direction of a ball

So this is the acceleration part of of the problem.

For the ball going direction up the acceleration vector of (0.0, 0.1) is correct.

However, when you want to know the velocity and position of the object ball after a collision it is different because the ball will travelling at an angle. So to apply the damping acceleration properly you need to rotate this vector by an angle. This is why 2D rotation of a vector is in the 2D library. Make sure you get your angles defined correctly so make the x - axis 0.0 degrees and the y axis 90 degrees etc.

# data[].attributes.body
Yes, these will begin next week

# data[].attributes.body
No they are different -magnitude is the length of a vector and is a scaler quantity and scaler multiple just mean multiply each vector component by a scaler and this returns another (scaled) vector. See lecture notes.

# data[].attributes.body
Best to express this in metres. You can make the original cue ball position (0,0)

# data[].attributes.body
Sir, specification says that the radius of one ball is  26mm  and cue is distance of 0.70m away. Can I convert all to centimeters to output the results? thanks

# data[].attributes.body
Should the damping force be treated as a force of 0.1N or as an acceleration of 0.1ms^2, because the specification says both

# data[].attributes.body
hi there im confused as to what the difference is between the magintude and scaler multiple of a vector. are they not just the same thing in essence

# data[].attributes.body
Hello, Are we going to have viva for this coursework? If so when would it be?

# data[].attributes.body
It says you need the mass to calculate the velocity from a given impulse, Do I use any mass i want to calculate the velocity from the impulse? Like the projectile could be 0.1kg or is there another equation to use?

# data[].attributes.body
Looks ok for Part A.

Part is 3D so this just means you use the 3D vector library instead of the 2D. As regards the impulse all this means is that you need to calculate the initial velocity (after impulse) using the equations found on the lecture notes. You only need to do this at the beginning of the problem and it is not part of the time stepping, it just defines the initial conditions of velocity and position (take to be 0,0,0

# data[].attributes.body
Part A) I did part A and I was wondering if I did it correctly(reefer to screenshot  please). I checked the x and y position from the website below and I got exactly the same values for x and y. https://www.desmos.com/calculator/gjnco6mzjo
Part B) for part B , is it same as 2D but with z position and  impulse.

# data[].attributes.body
No this is correct as it always slows the motion by this amount whatever the ball direction. So when a ball direction changes you need to rotate the damping vector by that angle and apply the new vector. So if you want to apply this to a ball going at 45 degrees for example (taking y as up the table) then this is this vector rotated by 45 degrees. 2D rotation is one of  the vector maths functions you have created so this is what you use.

# data[].attributes.body
Part C) says the damping force should be equivalent to (0.0,0.1) should this be (0.1,0.1) to slow the balls in both components rather than just the y component?

# data[].attributes.body
Yes, in component form see this for a nice example of angle and mag to components.
https://www.khanacademy.org/math/precalculus/vectors-precalc/component-form-of-vectors/e/converting-from-magnitude-and-direction-form-to-component-form

# data[].attributes.body
Hi Philip, should I show the answer to velocity vector as horizontal velocity and vertical velocity? Thanks

# data[].attributes.body
Post your queries and comments to me here. You can also add images etc.
Do not share your own code here as this is purely for support. It is fine to share code given in tutorials if you are seeking explanation. It is also ok to answer queries from fellow students but avoid direct collaboration.