Linked Questions

27 votes
6 answers
51k views

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°
NullPointerException's user avatar
264 votes
9 answers
250k views

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 (...
orlp's user avatar
  • 119k
1 vote
5 answers
2k views

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,...
rassoh's user avatar
  • 724
1 vote
2 answers
939 views

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 / ...
Robert Kaufmann's user avatar
2 votes
3 answers
1k views

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 ...
Lolslayer's user avatar
0 votes
3 answers
2k views

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 ...
HugoRune's user avatar
  • 13.9k
0 votes
1 answer
920 views

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. ...
J Vargas's user avatar
1 vote
1 answer
580 views

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 ...
Apollo42's user avatar
5 votes
2 answers
262 views

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 ...
MaxU - stand with Ukraine's user avatar
0 votes
2 answers
472 views

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'...
VVK's user avatar
  • 445
0 votes
1 answer
374 views

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 ...
RaptorDotCpp's user avatar
  • 1,475
2 votes
2 answers
190 views

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? ...
Hrisip's user avatar
  • 920
0 votes
1 answer
146 views

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 ...
Ravneet_Kaur's user avatar
0 votes
1 answer
215 views

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. ...
Gabor's user avatar
  • 5
0 votes
0 answers
73 views

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? ...
Tyrcnex's user avatar
  • 199

15 30 50 per page