Public Group

# ploting a curve

This topic is 5482 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

ok i have a point of impact I i have a speed S how do i use this information to make the object that is impacting reflect in an ark off that object? (whats the math involved here?)

##### Share on other sites
Trying as hard as I can to not be snarky...

Assuming you want the absolutely most simple collisions, you also need to know something about the object that is being hit. Generally, you just reverse the speed portion that is perpendicular to the face of the object that is hit.

If a ball going 1,1 hits a surface that is vertical, it will then be going -1,1 [as the x axis is perpendicular to the vertical surface]

And know that makes -MANY- assumptions and will pretty much only apply for pong or breakout style games.

##### Share on other sites
yeah i know that and that work great but now im going for acctually curving the ball path (you know like when you put spin on a ping pong ball).
[EDIT]
this is a 2d project

##### Share on other sites
with my calculator i can get the effect i want with

#(AX/\-1)
/\ = to the power of
# = square root

##### Share on other sites
well if thats what you want, theres a sqrt() function inside math.h or cmath. just do

sqrt( ((A*X)*(A*X)) - 1)

##### Share on other sites
cool i was wondering how i could do sqr roots thanks

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 22
• 16
• 13
• 14