@griges The Problem with Just Using tan(X/Y)
If you try to get the angle with tan(X/Y), it doesn't always give the correct direction because it only works in one part of the coordinate system. Imagine a compass—tan() doesn’t know whether you're facing North-East or South-West properly.
The Right Way is Using atan2()
Instead of tan(), we use atan2(X, Y), which correctly figures out which way to turn, no matter where the target is.
How It Works
Find how far away the target is in the X and Y directions:
X = Latitude - TargetLatitude Y = Longitude - TargetLongitude
Plug those values into atan2() like this:
TargetHeading = atan2(X, Y)
This gives the correct angle to turn toward the target.
Hey MSLITecnik here just wanna say, so you've just remove some parts which good thing that moderators didnt warn so you can just reupdate it with some things and do not copy people's things for upvotes twhank you!
BRO FINALLY DID IT!!!
+2i think we published at a same time
+2so gud
+2@KSB24 i made it roll over when its speeding hehehe
+2@KSB24 "JESUS TAKE WHEEEEEEL"
+2@KSB24 that was just simple than rather figuring it out with 100 messages in gpt
+2@LunarEclipseSP anything yall want i do dedication
+1@LunarEclipseSP sure
+1@Kendog84 GTA vice city..
+1@griges we use like atan(x) or atan2(x,y)
+1@griges The Problem with Just Using tan(X/Y)
If you try to get the angle with
tan(X/Y)
, it doesn't always give the correct direction because it only works in one part of the coordinate system. Imagine a compass—tan() doesn’t know whether you're facing North-East or South-West properly.The Right Way is Using atan2()
Instead of tan(), we use
atan2(X, Y)
, which correctly figures out which way to turn, no matter where the target is.How It Works
Find how far away the target is in the X and Y directions:
X = Latitude - TargetLatitude
Y = Longitude - TargetLongitude
Plug those values into atan2() like this:
TargetHeading =
+1atan2(X, Y)
This gives the correct angle to turn toward the target.
@griges use it simply its logic in simpleplanes :)
+1@LunarEclipseSP happy big choccy cake BIRD-DAY
+1Happy 100K points! ~ (me)
+1'' WHAT DID BRO WIN???!!! '' ~ idk
@griges oh thats wat I NOT know
+1@WNP78 can you add atan3?
Description
Calculate the angle between a vector and y-axis, not the x-axis as in atan2
Usage
atan3(x, y)
Arguments
x
The x coordinate from the (x, y) locations.
y
+1The y coordinate from the (x, y) location for an organism.
Somehow i don't understand the meth of FT
+1noice
+1@LunarEclipseSP shure
+1@KSB24 does that ting work
+1bro got 17 upvotes of a kinda emoji flying saucer
+1@KSB24 i finally did it! i made a folllowing tugboat
+1@YarisSedan is because i made a AI Marshall bus
+1@YarisSedan hehe
+1@YarisSedan yup lunar upvoted then 666
+1@BaronHeavyIndustries where did you get that mod like in the first thumbnail?
+1top notch
+1@Josephina577 k
+1ay its 2025 now @Josephina577
+1@SolarEclipseSP I didnt know there was a AI version of it sadly i wasted my time making a AI version
+1@Majakalona what the
+1@Josephina577 > TransPilipinas San Fernando Series 1
+1CNGRTS you are now at 800 points
+1i destroyed USS Beast with this one
+1its good btw
+1This kinda looks like a Seaplane from Modern Warships
+1@LunarEclipseSP what model
Good thing he is still alive
@griges !Trigonometry
@Convex true
Noice
Hey MSLITecnik here just wanna say, so you've just remove some parts which good thing that moderators didnt warn so you can just reupdate it with some things and do not copy people's things for upvotes twhank you!
@SamuelJamesCastor hahhaa
@ZackehCreationsPH ok!
give me what tank then :<
@RoyalTechnicalTeam Well y not mission accepted
@MSLITecnik but not half of KSB's SuPeR INteLIGience
@BARREND i would wana it
@BARREND i could do that if i had the knowledge because ive already made a working following tugboat
@RoyalTechnicalTeam Although the MC-21 at the tail is kinda good enough