Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

i need some help

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is off the top of my head:

Point A = (Ax, Ay) <-- this is the starting point (which you say is given)

Point B = (Bx, By)
= (Ax + length*cos(angle),Ay + length*sin(angle))

Slope = (By - Ay) / (Bx - Ax)

Hope that is correct.

EDIT: Added code tags to preserve formatting

[edited by - Erunama on May 31, 2002 5:07:20 PM]

Share this post

Link to post
Share on other sites
ok, after further testing of it, there is a problem.

the only angle ot really works on is 0

can you please see if there is a way to fix this


Share this post

Link to post
Share on other sites
pyro: What form are you storing your angles in, degrees or radians? If you are using degrees, then of course you will be having problems because trig functions use radian measure.

To convert, just multiply the degree measurement by 180/PI

Here''s a little real code/pseudo-code:

#define PI 3.14159
angle = angle*180/PI

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!