Linked Questions
16 questions linked to/from How can I find the smallest difference between two angles around a point?
27 votes
6 answers
51k views
How do I calculate the difference of two angle measures? [duplicate]
How can I calculate the difference of two angle measures (given in degrees) in Java so the result is in the range [0°, 180°]? For example: 350° to 15° = 25° 250° to 190° = 60°
264 votes
9 answers
250k views
How to calculate the angle between a line and the horizontal axis?
In a programming language (Python, C#, etc) I need to determine how to calculate the angle between a line and the horizontal axis? I think an image describes best what I want: Given (P1x,P1y) and (...
1 vote
5 answers
2k views
Calculate absolute distance of two rotation degrees, as a number (in JavaScript)
I would like to calculate the distance between two degree values. I know that I could use this if the points just where on one axis: var dist = Math.abs( x1 - x2 ); ...but the problem with degrees is,...
1 vote
2 answers
939 views
Rotation - Finding when desired angle is reached
Situation I've been hitting my head on this problem for a while now. Basically, I have an angle r (radians), that I want to change to a desired angle wr (radians) with a set speed dr (radians / ...
2 votes
3 answers
1k views
Angle difference between -180 and 180
I know a way to find the angle difference of two angles between [0,180], but I'm trying to find out a way to find the angle difference of two angles between [-179,180]. My code is as follows; it ...
0 votes
3 answers
2k views
Finding edges in a height map
I want to find sharp edges in a heightmap image, while ignoring shallow edges. OpenCV offers multiple approaches to finding edges in a 2d Image: Canny, Sobel, etc. However, all these approaches work ...
0 votes
1 answer
920 views
Dealing with consecutive angles near 2*pi (360 deg) in Python
I haven't found a topic similar so I am asking I am dealing with optimization of mechanism where I found bunch of variables as length, coordinates and some variables are angles between 0 and 2pi. ...
1 vote
1 answer
580 views
Numpy unwrap error when using apply() on Pandas dataframe
I have a Pandas DataFrame which has two columns containing some angles in the range [-pi, pi). I need to calculate the instantaneous angular velocity on each row, which I can do using diff(), however ...
5 votes
2 answers
262 views
Elegant (most efficient) way to check whether the angle falls into the circular confidence interval
I have the following sample dataset: In [222]: df Out[222]: ci_low circ_time_angle ci_high 0 30 30 30 1 10 0 20 2 -188 143 ...
0 votes
2 answers
472 views
On the edge of 0 and 360 degrees (or radians -PI and PI)
I have a little demo in Processing of circular repulsion. It works great except the moment when object and its repulsor (mouse) have degrees close to 360 | 0 zone (or PI | -PI ). or YouTube video It'...
0 votes
1 answer
374 views
Inbetweening a rotation
I have an image (let's say it's a simple rectangle) positioned on the left of my screen, which I can move up and down. When moving it upwards, I use some simple trigonometry to rotate it so that the ...
2 votes
2 answers
190 views
Best way to find minimal difference between two values in a cyclic system?
Take for example time: If we take a 12-hour clock, we'd get the following results from 1 to 5 = 4 from 5 to 1 = 4 from 11 to 1 = 2 from 1 to 11 = 2 What is the most efficient way to do that? ...
0 votes
1 answer
146 views
How can I store nodeId, direction,and speed of a vehicle in RSU in veins version 5?
Thank you for reading the question. I have a simple query that when vehicles are broadcasting a message then the event happened and re-routing of vehicles are being done. But if I want to store the ...
0 votes
1 answer
215 views
Find the points between two points on a circle in the smaller angle
So the idea is that I want to get 20 points in X,Y coordinates between two clicks on a cirlce. The only criteria is that the points always have to be between the smaller angle between the 2 clicks. ...
0 votes
0 answers
73 views
Smoothly transitioning one mesh to another
I have two meshes Mesh1 and Mesh2. Mesh1 does not necessarily have the same amount of vertices or faces as Mesh2. What is the best way to "transition" between these two meshes smoothly? ...