# How do I calculate Position (X,Y) using Angle and Distance ?

1 favourites
• 6 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
• How do I calculate Position (X,Y) if I know the Angle and Distance ? I know it has something to do with sin and cos, but trigonometry was never one of my strong points

• Here's the equations for that.

X=distance*cos(angle)

Y=distance*sin(angle)

But this is an angle and distance from the origin (0,0), usually you want the position (x,y) an angle and distance from another position (x0, y0).

X=distance*cos(angle) +x0

Y=distance*sin(angle) +y0

• How do I calculate Position (X,Y) if I know the Angle and Distance ? I know it has something to do with sin and cos, but trigonometry was never one of my strong points

What do you need it for? Was thinking that there might be an easier way, if people knew what you wanted to use it for,

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• Thank you for your help. In the meantime I've found this thread and adapted after it, but is good to know I was on the right track

Looks that I lived under a rock in the past months since only recently I've found the [Behavior] LiteTween which helps me skip a lot of math, events and time

I needed to know this formula since I am working with the Bullet behavior. Here are my events (kind of messy at the moment ... I will try to make them cleaner later):

• Wow, math! Thanks

• I've got rid of the variables and made it as an universal Function (with parameters) for the player getting hit

• 6 posts