Questions tagged [angle]

A shape, formed by two lines or rays diverging from a common point (the vertex).

Angle is also used to designate the measure of an angle or of a rotation. This measure is the ratio of the length of a circular arc by its radius. In the case of an angle (figure), the arc is centered at the vertex and delimited by the sides. In the case of a rotation, the arc is centered at the center of the rotation and delimited by any point and its image by the rotation.

Source: mathopenref wikipedia

1421 questions
7
votes
3 answers

Flipping an angle using radians

Hello all you math whizzes out there! I am struggling with a math problem I am hoping you can help me with. I have calculated an angle of direction using radians. Within OpenGL ES I move my guy by changing my point value as such: spriteLocation.x…
Scott
  • 874
  • 3
  • 12
  • 36
7
votes
3 answers

Incorrect angle, wrong side calculated

I need to calculate the angle between 3 points. For this, I do the following: Grab the 3 points (previous, current and next, it's within a loop) Calculate the distance between the points with Pythagoras Calculate the angle using Math.acos This…
Broxzier
  • 2,909
  • 17
  • 36
7
votes
1 answer

Finding velocity vector based on angle and speed

I am programming some movement for AI for a game based on angle and speed.Its a 2D program based on x,y axis. I currently have a position vector as-well as a velocity vector which accounts for speed and current direction of the AI.Every time I move…
Tohmas
  • 547
  • 2
  • 7
  • 14
7
votes
7 answers

Programming a smooth change of thrust from current velocity vector to a target vector

TL;dr: "I am not sure how to calculate a smooth transition of thrust between one vector and another." I am programming a simple game where an enemy chases after the player in an open space (no walls). I was calculating the enemy's x & y velocities…
user128526
  • 111
  • 1
  • 4
  • 10
7
votes
3 answers

The X angle between two 3D vectors?

I have two 3D vectors called A and B that both only have a 3D position. I know how to find the angle along the unit circle ranging from 0-360 degrees with the atan2 function by doing: EDIT: (my atan2 function made no sense, now it should find the…
Arundel
  • 115
  • 2
  • 2
  • 9
7
votes
4 answers

check if two segments on the same circle overlap / intersect

Given two circle segments of the same circle: A=[a1, a2] and B=[b1, b2], with: a1, a2, b1, b2 values in degree between -inf and +inf a1 <= a2 ; b1 <= b2 a2-a1<=360; b2-b1<=360 How can I find out if these two circle segments overlap? (i.E. if they…
HugoRune
  • 13,157
  • 7
  • 69
  • 144
7
votes
3 answers

OpenCV RotatedRect with specified angle

I have the situation that I have a small binary image that has one shape, around which I want to find the best fitting rotated rectangle (not bounding rectangle). I know that there is cv::minAreaRect() that you apply on the result found by…
MShekow
  • 1,526
  • 2
  • 14
  • 28
6
votes
5 answers

How to determine whether V3 is between V1 and V2 when we go from V1 to V2 counterclockwise?

I have three vectors V1, V2, and V3. Their origin points are on the axes' origin. How could I determine whether V3 is between V1 and V2 when I move around counterclockwise from V1 to V2? alt text…
Kamran Bigdely
  • 7,946
  • 18
  • 66
  • 86
6
votes
6 answers

Given the x and y components of the velocity, how can the angle be computed?

For a particle moving about in a Cartesian coordinate system (neglecting the z-axis), how can the angle of travel be computed given the x and y components of the velocity? Before anyone says this isn't programming related, I am programming this…
farm ostrich
  • 5,881
  • 14
  • 55
  • 81
6
votes
1 answer

Arrow rotating to face cursor needs to only do so while inside an angle made by two given directions

I have a 2d arrow rotating to always face the a target (the target in this case is the cursor), the pivot is my player character. I need to restrict this arrow to only follow the target if it is inside an angle of the player, an example would be 90…
user11725994
6
votes
3 answers

Longitude / Latitude to quaternion

I've got a longitude and latitude and want to convert this to a quaternion and wondering how I can do this? I want to use this, because I've got an app which projects the earth on a sphere and I want to rotate from one location to another one. Best!
rick
  • 61
  • 1
  • 3
6
votes
1 answer

Convert a Unit Vector to a Quaternion

So I'm very new to quaternions, but I understand the basics of how to manipulate stuff with them. What I'm currently trying to do is compare a known quaternion to two absolute points in space. I'm hoping what I can do is simply convert the points…
Hmm
  • 71
  • 1
  • 2
6
votes
2 answers

C++ Move 2D Point Along Angle

So I am writing a game in C++, currently I am working on a 'Compass', but I am having some problems with the vector math.. Here is a little image I created to possibly help explain my question better Ok, so as you can see the 2D position of A…
rflxdev
  • 143
  • 2
  • 2
  • 11
6
votes
1 answer

Finding the angles for the X, Y and Z axis in 3D - OpenGL/C++

I am currently trying to use OpenGL (With SDL) to draw a cube to the location where I left click in the screen and then get it to point at the position in the screen where I right click. I can successfully draw a cube at my desired location using…
Lucas
  • 10,476
  • 7
  • 39
  • 40
6
votes
1 answer

Using bounding rectangle to get rotation angle not working (OpenCV/Python)

I'm trying to straighten this letter but I'm not sure how to use the bounding rectangle to do so. Here's what I have so far: import cv2 import numpy as np img = cv2.imread('rtes.jpg',0) ret,thresh =…
222
  • 95
  • 1
  • 8