[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math

Search:


View post   

>> No.15095980 [View]
File: 223 KB, 1080x837, Screenshot_20230103_014205_Firefox.jpg [View same] [iqdb] [saucenao] [google]
15095980

>>15095316
https://brilliant.org/wiki/convert-cartesian-coordinates-to-polar/

It causes problems when converting from cartesian to polar because the domain of arctan can only go from -pi/2 to pi/2, and doesn't cover a full -pi to pi.

The way I do it is always graphical, I ignore the signs of x and y, and calculate the angle between the x axis and the polar coordinate, then I'll add or take pi from there to get the angle.

The image and link seem to have a formula like yours though. Which doesn't need any graphical stuff.

On a side note, if you ever do any programming and want an arctan function with a domain of 2 pi, in C++ the function is called std::atan2(x, y), and it has a corresponding function in C too.

https://en.cppreference.com/w/cpp/numeric/math/atan2

Hope this helps, and sorry if I misunderstood something, or how things work here. I'm rather new to 4chan.

Navigation
View posts[+24][+48][+96]