#### Archived

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

# Getting destination with an angle

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

## Recommended Posts

Ive been trying to figure out how to get destination points given a certain angle. I''ve been using sin and cos for amounts moved, but Im having a problem finding edge destinations. For example, I have a ship on the screen, and it is facing at any angle (0-360), how would I check where a line from the ship intersects the edge of the screen? My res. is 1024x768. My brain is fried, any help is appreciated. Thanks- Jeff

##### Share on other sites
Solve the equations :

left edge : x = 0
ship : x = x0 + t.cos(a), y = y0 + t.sin(a)

solve for t, that gives you the intersection with the left edge.

Lather, rinse, repeat.

##### Share on other sites
Xcellent, thank you for the help!

1. 1
2. 2
Rutin
17
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633735
• Total Posts
3013594
×