atan2 Questions

5

Solved

I am struggling with this in JavaScript, but this problem applies to many other languages/environments as well. I want to have one object rotating towards the position of another object, and I use...
Muire asked 10/7, 2013 at 15:15

16

Solved

atan2(y, x) has that discontinuity at 180° where it switches to -180°..0° going clockwise. How do I map the range of values to 0°..360°? here is my code: CGSize deltaPoint = CGSizeMake(endPoint.x -...
Esbjerg asked 21/8, 2009 at 9:57

4

Solved

I need to calculate the angle between lines. I need to calculate atan. So I am using such code static inline CGFloat angleBetweenLinesInRadians2(CGPoint line1Start, CGPoint line1End) { CGFloat d...
Penoyer asked 2/11, 2010 at 16:54

3

Solved

I have U and V wind component data and I would like to calculate wind direction from these values in R. I would like to end up with wind direction data on a scale of 0-360 degrees, with 0° or 360° ...
Insurgent asked 31/1, 2014 at 16:5

3

Solved

I am working on a spatial analysis problem and part of this workflow is to calculate the angle between connected line segments. Each line segment is composed of only two points, and each point has...
Replica asked 1/2, 2015 at 8:44

3

Solved

I'm seeing differences between Firefox and Safari in the last digit of the output from Math#atan2. My code: Math.atan2(-0.49999999999999994, 0.8660254037844387) Safari (12.1.1) gives -0.5235987...
Salesclerk asked 7/6, 2019 at 1:19

1

Solved

I have come across a function which computes atan(x) (the source is here). Reducing it to the core of my question and slightly reformatting it, they have something like that: static const double o...
Mudskipper asked 19/2, 2019 at 18:51

6

Solved

Math has defeated me once again. This is such a simple task, but I can't manage to get it done. Scenario: I draw on a SurfaceView a round image. The user touches a point on image border and starts...
Gutshall asked 28/10, 2011 at 8:26

5

Solved

In GLSL (specifically 3.00 that I'm using), there are two versions of atan(): atan(y_over_x) can only return angles between -PI/2, PI/2, while atan(y/x) can take all 4 quadrants into account so th...
Crumby asked 27/9, 2014 at 1:27

4

Solved

Lets say I'm using atan2 to get the angle between two vectors. atan2 gives a value in radians. I convert it to degrees using a built in function in Java. This gives me a value between 0 and 180 de...
Sardinian asked 1/2, 2014 at 1:59

1

Solved

I'm currently trying to convert given Cartesian coordinates (x,y,z) to spherical coordinates (r, theta, phi) using the ParaView Calculator-Filter, where theta is the polar angle and phi the azimuth...
Melson asked 19/10, 2016 at 8:29

4

Solved

Normally, polar coordinates go from 0 to π to 2π (just before 2π really, as it equals 0 again). However, when using the JavaScript atan2() function, I'm getting a different, weird range: ...

3

Solved

OK firstly apologies as I know this kind of question has been asked before more than once. However even after looking at the other questions and answers I have been unable to get this to work for m...
Hetero asked 25/3, 2015 at 14:55

1

Solved

I need to execute the ATAN2 function in MS SQL Server. How do I do this? T-SQL appears to have all the usual math functions like cos, sin, radians etc, just not ATAN2. What is the function for thi...
Rata asked 15/9, 2014 at 12:36

1

Solved

I am trying to transform an image (represented as a matrix) in R, into polar coordinate space with the origin being 0,0 (top left corner). Given the 215x215 matrix x which looks like: x0 = as.v...
Divider asked 27/5, 2013 at 15:45

4

Solved

I am calculating angles from a 3-axis accelerometer, but my compiler doesn't have a atan or atan2 function. It has a reserved memory slot, but it calls a function i can't find in any files. My com...
Prehistory asked 13/8, 2012 at 8:26
1

© 2022 - 2025 — McMap. All rights reserved.