Jump to content
Sign in to follow this  
LiveOnTheFly

Angle calculation

Recommended Posts

LiveOnTheFly

I have object X

object X is moving at a angle of 172

How can I calculate object X's next position?

Share this post


Link to post
Share on other sites
TerarinK

Well where is the object X at to start off from and what is angle relative to? If you say Object X is at 0,0 moving 172 degrees at relative to 0,0 grid based and we are presuming it would be decimals. That would mean your ship turned and is going 8 degrees on the upper axis so your going and you would reach 1,-.09 as your next target however if you need both of them digits then a rough estimate of 11,-1 would be your next full int digit


0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E

Share this post


Link to post
Share on other sites
Kip

I have object X

object X is moving at a angle of 172

How can I calculate object X's next position?

You'll have to know the speed/distance too.

And learn how to use Tan, Sin and Cos.

Share this post


Link to post
Share on other sites
LiveOnTheFly

Sorry for being stupid and not using the search button(silly me).

I found what I needed

Func Angle($x1, $y1, $Ang, $Length)

Local $Return[2]

$Return[0] = $x1 + ($Length * Cos($Ang / 180 * 3.14159265358979))

$Return[1] = $y1 - ($Length * Sin($Ang / 180 * 3.14159265358979))

Return $Return

EndFunc ;==>Angle

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.