Can any one please assist with code for two objects coming from different direction. Subsequently, collide after intersection. The objects should be moving at 80km/h. And collision should happen shortly 30 minutes after take off

Recommended Answers

All 6 Replies

Can any one please assist with code for two objects coming from different direction. Subsequently, collide after intersection. The objects should be moving at 80km/h. And collision should happen shortly 30 minutes after take off

That's a program with many parts. You need to provide much more information. Is this a console application or a GUI? What do the objects look like? What does 80 km/h mean in relation to the computer screen (i.e. what is the distance in kilometers of the computer screen width)? And many other details. You need to decide with much more specificity what you want, tell us what you know how to do already, and post at least an attempt at this.

Can any one please assist with code for two objects coming from different direction. Subsequently, collide after intersection. The objects should be moving at 80km/h. And collision should happen shortly 30 minutes after take off

This sounds like a physics problem with elements of-

Newton's Law
Conservation of Momentum
(Possible) Conservation of Energy

-You will most definitely need Conservation of Momentum since during the collision, there's no telling how much energy is lost from heat due to air resistance/crumpling. The first two laws should be a good start.

Also, what is the angle of misdirection? I have a program that can solve these kinds of problems but its written in Java.

This sounds like a physics problem with elements of-

Newton's Law
Conservation of Momentum
(Possible) Conservation of Energy

-You will most definitely need Conservation of Momentum since during the collision, there's no telling how much energy is lost from heat due to air resistance/crumpling. The first two laws should be a good start.

Also, what is the angle of misdirection? I have a program that can solve these kinds of problems but its written in Java.

It all depends on what the OP has in mind regarding the collision. He/she could be looking for a collision that follows all of the laws of physics to the letter or the collision could simply be to display "Kaboom!" in text when it happens. We have no way of knowing until the OP tells us.

A blue passenger train moves southwards at a speed of 80km/hr. Unfortunately as it enters a junction it collides with a brown goods train moving northwards. The collision happened 30 minutes after the goods train takes off. Use C++ to illustrate the above.

A blue passenger train moves southwards at a speed of 80km/hr. Unfortunately as it enters a junction it collides with a brown goods train moving northwards. The collision happened 30 minutes after the goods train takes off. Use C++ to illustrate the above.

You will most likely want to print the coordinates of both the train and the brown goods train every minute or second, and display their speed as well.

send me how to move aman

commented: Didn't you get it? -1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.