954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Code for moving

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

samaitaben
Newbie Poster
2 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 
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.

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 
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.

Alex Edwards
Posting Shark
972 posts since Jun 2008
Reputation Points: 392
Solved Threads: 109
 

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.

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

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.

samaitaben
Newbie Poster
2 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 
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.

Alex Edwards
Posting Shark
972 posts since Jun 2008
Reputation Points: 392
Solved Threads: 109
 

send me how to move aman

tamiruu
Newbie Poster
1 post since Dec 2010
Reputation Points: 9
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You