angle

Calculate angle from slope in inverted Y axis

Calculate angle from slope in inverted Y axis Question: I currently have a series of lines drawn in a football pitch, each one formed by an X and Y point. These lines are the passes of a player and I want to see if it is a backward pass, forward pass, lateral pass depending on …

Total answers: 1

the condition is the angle between two other angles

the condition is the angle between two other angles Question: I have a vector from a certain point, and its angle, there are also lines described by two points. I need to find the points of intersection of a vector with lines. I calculated the intersection, through the equation of lines, but in this case …

Total answers: 2

Find angle from triangle in python (Similar to using sin-1 on scientific calculators)?

Find angle from triangle in python (Similar to using sin-1 on scientific calculators)? Question: I want to find the angle from a triangle in Python. I searched other topics here but none of them helped me… My code: from math import hypot, sin opposite = 5 adjacent = 8.66 hypotenuse= hypot(opposite, adjacent) # Trigonometry – …

Total answers: 1

How can I make an output in radians with pi in it?

How can I make an output in radians with pi in it? Question: I want to give out an angle in radians in python. I also know how to do that but is it posible to make the output like that 1 * pi instead of 3.14159 without programming it myself? Thx for help. Asked …

Total answers: 2

Get a point's position from an angle and the length of the line

Get a point's position from an angle and the length of the line Question: I’m programming a game in Python, with pygame, and I’d like to make a function that draws a line in a specific direction from a point, with a specific length, for example, the definition of the funcion would be: def draw_line(position1: …

Total answers: 3

How to know the angle between two vectors?

How to know the angle between two vectors? Question: I am making small game with pygame and I have made a gun that rotates around its center. My problem is that I want the gun to rotate by itself to the enemy direction, but I couldn’t do that because I can’t find the angle between …

Total answers: 7

Calculate angle (clockwise) between two points

Calculate angle (clockwise) between two points Question: I have been not using math for a long time and this should be a simple problem to solve. Suppose I have two points A: (1, 0) and B: (1, -1). I want to use a program (Python or whatever programming language) to calculate the clockwise angle between …

Total answers: 8

Angles between two n-dimensional vectors in Python

Angles between two n-dimensional vectors in Python Question: I need to determine the angle(s) between two n-dimensional vectors in Python. For example, the input can be two lists like the following: [1,2,3,4] and [6,7,8,9]. Asked By: Peter || Source Answers: Using numpy (highly recommended), you would do: from numpy import (array, dot, arccos, clip) from …

Total answers: 13

Finding Signed Angle Between Vectors

Finding Signed Angle Between Vectors Question: How would you find the signed angle theta from vector a to b? And yes, I know that theta = arccos((a.b)/(|a||b|)). However, this does not contain a sign (i.e. it doesn’t distinguish between a clockwise or counterclockwise rotation). I need something that can tell me the minimum angle to …

Total answers: 2