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
10
votes
4 answers

How to find angle between two straight lines (paths) on a SVG in Javascript?

I have two straight lines as in SVG canvas. Using pixel coordinates of LineA (A1x, A1y) (A2x, A2y) and LineB (B1x, B1y) (B2x, B2y) how can I calculate the angle between these lines. I have below code which works for THREE points (it works…
XIMRX
  • 2,130
  • 3
  • 29
  • 60
10
votes
3 answers

Plot angle between vectors

I am searching for quite a while already now for a function that plots the angle between two arrows / line segments. e.g.: (source: matrix44.net) Can this be done easily or do I have to find the function of a segment of a radius? I am surprised…
pthesling
  • 241
  • 2
  • 7
10
votes
4 answers

Get angle of view of android camera device

I want to know the angle of view from the camera, just like in this question but using android.hardware.camera2. How can I reproduce the next code using the new camera2 library. Camera.Parameters p = camera.getParameters(); double thetaV =…
David D.
  • 101
  • 1
  • 1
  • 7
10
votes
3 answers

Get angle in terms of 360 degrees

I would like to get an angle in terms of 360 degrees... for my game, I need to know which direction the player is heading in... The code here gets the proper angles, but only in terms of 90 degree increments: (meaning, when I click in upper left…
user3871
  • 12,432
  • 33
  • 128
  • 268
10
votes
3 answers

Calculating angle between two points - java

I need to calculate the angle in degrees between two points, with a fixed point that is connected with the given two points by a line. Here is an image that illustrates what I need: Here is what I have tried so far: public static float…
David Lasry
  • 1,407
  • 4
  • 26
  • 43
10
votes
3 answers

Angle gradient in canvas

I'm looking for a code that permits to have this effect on a canvas' stroke. I've already got an animated circular stroke, I only need to get the ANGLE gradient, not linear and not radial. I've got only 3 colours. The existing one is available here…
AndrePliz
  • 259
  • 1
  • 2
  • 11
10
votes
3 answers

Continous angles in C++ (eq unwrap function in matlab)

I guess it is not that hard, but I have been stuck on that one for a while. I have a joint that can rotate both direction. A sensor gives me the angle of the joint in the range -pi and +pi. I would like to convert it in the range -infinity and …
Vince
  • 3,979
  • 10
  • 41
  • 69
9
votes
2 answers

How to calculate angle between two Geographical/GPS coordinates?

I have two GPS Coordinates e.g. (Lat1, Long1) and (Lat2,Long2) Could anybody please help me find the angle between those two points. Values should be 0-360 degrees.
Chintan Patel
  • 329
  • 2
  • 3
  • 5
9
votes
4 answers

Correcting the Yaw part of one Quaternion by the Yaw part of another one

I have the following problem: A quaternion (q1) from a motion capturing device needs to be corrected by the yaw angle (and only yaw!) from another orientation quaternion (q2) derived by a second tracked object, so that the pitch and roll of q1 is…
Raboon
  • 91
  • 1
  • 2
9
votes
3 answers

Given start point, angles in each rotational axis and a direction, calculate end point

I have a start point in 3D coordinates, e.g. (0,0,0). I have the direction I am pointing, represented by three angles - one for each angle of rotation (rotation in X, rotation in Y, rotation in Z) (for the sake of the example let's assume I'm one of…
Nick Udell
  • 2,420
  • 5
  • 44
  • 83
9
votes
1 answer

Getting the angle from a direction vector?

I have this simple function to set an angle for a vector. It effectively gets the vector's current magnitude (length), calulates the angle and converts the angle from radians to degrees. Then I apply the angle to X and Y, lastly multiplying the…
Matthew Spence
  • 986
  • 2
  • 9
  • 27
9
votes
5 answers

Calculate angle of triangle Python

I'm trying to find out the angle of the triangle in the following, I know it should be 90 degrees, however I don't know how to actually calculate it in the following: Here's what I've tried: angle = math.cos(7/9.899) angleToDegrees =…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95
9
votes
5 answers

Get angle between point and origin

This might have been answered before, sorry if it has. I basically need to get the angle from origin to point. So lets say Origin is (0, 0) and my target point is (3, 0). 3 O'clock = 90 degrees 6 O'clock = 180 degrees 9 O'clock = 270 degrees 12…
Dave
  • 591
  • 1
  • 8
  • 21
9
votes
1 answer

How to detect mouseenter direction on a specific element

I currently have a function which detects the direction of the mouse enter. It returns an integer (0-3) for each section as illustrated below. I'm trying to figure out how to alter this function to produce an output based on this…
ahren
  • 16,803
  • 5
  • 50
  • 70
9
votes
3 answers

Get tilt angle from the android accelerometer

I have a class that implements SensorEventListener and I would like to get the tilt Angle of my device using the Accelerometer. I looked for examples on the internet but they use Sensor.TYPE_MAGNETIC_FIELD. I believe my device doesn't have this…
user1615888
  • 91
  • 1
  • 1
  • 3