The atan2 Function - Friday Minis 260

The atan2 Function - Friday Minis 260

0612 TV w/ NERDfirst

5 лет назад

49,407 Просмотров

The atan function in programming languages usually comes with a cousin, the atan2 function. Today, with the help of a bit of math, let's see why it is needed!

= CREDITS =
My appreciation extends to the creators of the following external assets that made this video possible:
Blown Away by Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0
http://creativecommons.org/licenses/by/3.0/
ISRC: USUAN1200100

= 0612 TV =
0612 TV, a sub-project of NERDfirst.net, is an educational YouTube channel. Started in 2008, we have now covered a wide range of topics, from areas such as Programming, Algorithms and Computing Theories, Computer Graphics, Photography, and Specialized Guides for using software such as FFMPEG, Deshaker, GIMP and more!

Enjoy your stay, and don't hesitate to drop me a comment or a personal message to my inbox =) If you like my work, don't forget to subscribe!

Like what you see? Buy me a coffee → http://www.nerdfirst.net/donate/

0612 TV Official Writeup: http://nerdfirst.net/0612tv
More about me: http://about.me/lcc0612
Official Twitter: http://twitter.com/0612tv

= NERDfirst =
NERDfirst is a project allowing me to go above and beyond YouTube videos into areas like app and game development. It will also contain the official 0612 TV blog and other resources.

Watch this space, and keep your eyes peeled on this channel for more updates! http://nerdfirst.net/

-----

Disclaimer: Please note that any information is provided on this channel in good faith, but I cannot guarantee 100% accuracy / correctness on all content. Contributors to this channel are not to be held responsible for any possible outcomes from your use of the information.

Тэги:

#0612 #0612_TV #nerdfirst #nerdfirstnet #nerdfirst.net #atan #atan2 #programming #computer_science #algorithms #math
Ссылки и html тэги не поддерживаются


Комментарии:

@Jacine-rv6vg
@Jacine-rv6vg - 26.05.2024 12:19

thank you so much I've looking in how to do it for so much time!!!

Ответить
@furankoga
@furankoga - 25.03.2024 16:51

thank you so much! very helpful!

Ответить
@JC-xh8xe
@JC-xh8xe - 21.03.2024 12:47

Thank you. Was trying to understand this, in surveying I use Arctan x/y, because of 0 degrees being north, then we go clockwise instead of counter clockwise.

I was using Arctan in excel with if statements to choose the quadrant given the signs.

Now I can use =ATAN2(deltaN, deltaE) and I will get the same result. I have set up an IF statement if the angle is less than 360 to add 360, otherwise it is the correct angle. Works well.

Thank you for helping me visualise the unit circle and relate it to the compass bearings we are used to after using them for so long.

Ответить
@aleksandarv.1459
@aleksandarv.1459 - 17.01.2024 03:19

Great explanation, keep up the good work!

Ответить
@theman7050
@theman7050 - 10.01.2024 13:51

Thanks man. I keep coming back to refer this video 😊

Ответить
@dasupaking
@dasupaking - 19.12.2023 07:08

Simple but Profound! Thank you! :)

Ответить
@scoobydoobies
@scoobydoobies - 17.12.2023 15:39

Bruh thank you. Finding the angle between two points is super useful,

Ответить
@rasimakifzade
@rasimakifzade - 13.12.2023 16:12

great job!

Ответить
@qzorn4440
@qzorn4440 - 06.12.2023 03:49

great information. 😎 Thanks.

Ответить
@ian.ambrose
@ian.ambrose - 01.10.2023 06:12

Thank you. Such a Chad.

Ответить
@theman7050
@theman7050 - 15.09.2023 17:39

Thank you. It finally makes sense :)

Ответить
@Retrofire-47
@Retrofire-47 - 22.06.2023 20:35

Legend.

Ответить
@lksxxtodin5292
@lksxxtodin5292 - 24.05.2023 21:16

I confuse atan with atan2 haha. Thanks for the vídeo

Ответить
@Jonnio
@Jonnio - 24.04.2023 01:21

Wish I knew this few years ago lol

Ответить
@aboodnasr73
@aboodnasr73 - 25.03.2023 06:00

It's helpful. Thanks a lot

Ответить
@ruruchan7230
@ruruchan7230 - 06.03.2023 10:52

Thank you great video very helpful. I was wondering if I were to use a calculator to find the answer what would I insert? because as you know the simple tan-1(y/x) wouldn't give the right answer for quadrants 2 and 3

Ответить
@kipchickensout
@kipchickensout - 20.12.2022 01:16

I didn't quite get the wikipedia explanation but this was easypeasy to understand thanks!

Ответить
@John_Macaroni
@John_Macaroni - 03.11.2022 23:24

Very helpful video!! small question: Why don't we just use atan2 all the time since it's so much better than atan?

Ответить
@l_a__z_y
@l_a__z_y - 15.08.2022 07:48

Thank you, man!!!!!!!!!

Ответить
@zerosum535
@zerosum535 - 05.06.2022 03:19

Thanks man

Ответить
@mattschemmer3091
@mattschemmer3091 - 05.05.2022 05:54

Been using it, but never quite understood why. Great vid!

Ответить
@davidkim617
@davidkim617 - 22.04.2022 19:38

I almost lost my mind to figure out WTF is Atan2, and you just saves my day!! Thank you so much!!!!

Ответить
@MegaWv3
@MegaWv3 - 12.04.2022 14:17

thank you sir!

Ответить
@hullyoung
@hullyoung - 10.04.2022 21:51

Very very well explained! Thanks!

Ответить
@VideomasterPDB
@VideomasterPDB - 26.02.2022 13:34

This was brilliant. short, simple. to the point. giving basic understanding of Atan originally and then comparing and the use of diagrams

Ответить
@sidneysherrill4870
@sidneysherrill4870 - 14.01.2022 03:38

Fantastic video. So well done. Thank you!

Ответить
@harrytraskos5964
@harrytraskos5964 - 26.12.2021 19:48

Thank you, for really nice explanation :D

Ответить
@zekumoru
@zekumoru - 07.12.2021 02:39

It's very concise and easy to grasp. I was googling atan2 but I was bombarded with lots of technical jargon. Great job!!

Ответить
@gabrijelagavric6247
@gabrijelagavric6247 - 21.10.2021 20:22

lol sitting in a coffee shop called Well and Good (a phrase you said in the video). Glad you made this, helped.

Ответить
@asarachar7956
@asarachar7956 - 15.09.2021 03:48

It helps me to find out more what iam doing now. Thanks

Ответить
@VoxaFPS
@VoxaFPS - 15.09.2021 00:17

brother in my game after get value from atan2() i need to get negative of atan2() like angle = - atan2(y,x) why that happen ?

Ответить
@teflonpan115
@teflonpan115 - 16.08.2021 08:33

a concrete example would have been nice

Ответить
@victormbebe3797
@victormbebe3797 - 01.08.2021 02:06

simple and clear. Thank you. mozambican from Brazil.

Ответить
@JonesCrimson
@JonesCrimson - 13.06.2021 00:51

Most of the early years of programming is just discovering some guy or gal in the 80s or 90s figured out the solution to the problem you're working on and game development is no exception.

Ответить
@BEExPyro
@BEExPyro - 03.06.2021 06:55

This was exactly what I wanted to find when I searched mathf.atan2

Ответить
@nirmithrjain6265
@nirmithrjain6265 - 22.05.2021 13:21

Thanks man, it was very helpful 👍

Ответить
@happy_moth
@happy_moth - 02.04.2021 05:26

commenting to feed the algorithm because this helped me understand the function a lot better :)

Ответить
@3d_blunders
@3d_blunders - 16.03.2021 12:17

Thanks man i really needed this

Ответить
@ClutchGen
@ClutchGen - 01.03.2021 10:46

Great explanation!! Thank you!

Ответить
@antoniopugliese3004
@antoniopugliese3004 - 26.02.2021 13:44

Thank you soooo much,
my robotics teacher didn't make me understand!

Ответить
@sews5742
@sews5742 - 25.02.2021 00:56

at times you sound just a little bit like rayner teo

Ответить
@GamingAlgen
@GamingAlgen - 06.01.2021 13:45

Roses are red
violets are blue
There's always a Asian better then you

wait , I'm also Asian 0_0

Ответить
@kimtanatfree8220
@kimtanatfree8220 - 22.12.2020 04:22

like

Ответить
@RoboClonk
@RoboClonk - 24.10.2020 13:18

Perfect explanation, thanks!

Ответить
@ivantishchenko4686
@ivantishchenko4686 - 13.07.2020 12:58

Great video. Thank you!

Ответить
@mentionethan
@mentionethan - 12.05.2020 04:00

this is extremelye helpful, especially when your teacher doesnt understand code himself so you gotta figure things out to pass

Ответить
@has921
@has921 - 08.04.2020 20:43

Thank you for this excellent video. Having just seen a program using atan2() and a bunch of coordinate calculations, I had no idea what it was doing. This video summed it up perfectly.

Ответить
@qqqquito
@qqqquito - 17.11.2019 01:45

I just noticed that there are a number of webpages devoted to the question: Why aren't there asin2() and acos2() functions? After thinking a bit about it, I realized that this is because atan2 relies on the value of atan(y/x) along with the signs of x and y. But this task can also be accomplished by using asin(y/sqrt(x^2+y^2)) or acos(x/sqrt(x^2+y^2)) along with the signs of x and y. So the function could have been called something like angle_finder().

Ответить
@qqqquito
@qqqquito - 03.11.2019 06:24

The sad thing is that many people have extensively used functions asin, acos and atan but are still unaware of the existence of atan2.

Ответить
@dcpowered
@dcpowered - 23.10.2019 15:33

Thank you for this nice video!

Ответить