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

1278 questions
27
votes
6 answers

Rotating Image on A canvas in android

I want to Rotate Image according to a specific angle in android ,some thing like a compass... I have this code...it works on drawPath() but i want to replace the path and the Drawing thing with image.. I tried to create a bitmap image…
Reham
  • 1,776
  • 6
  • 19
  • 44
25
votes
5 answers

Getting angle back from a sin/cos conversion

I want to reverse a sin/cos operation to get back an angle, but I can't figure out what I should be doing. I have used sin and cos on an angle in radians to get the x/y vector as such: double angle = 90.0 * M_PI / 180.0; // 90 deg. to rad. double…
Eric Fortier
  • 710
  • 1
  • 7
  • 15
22
votes
2 answers

What's a quaternion rotation?

Is quaternion rotation just a vector with X,Y,Z which the object will rotate towards, and a roll which turns the object on its axis? Is it that simple? Meaning if you have X=0, Z=0 and Y=1 the object will face upwards? And if you have Y=0, Z=0 and…
Robin Rodricks
  • 99,791
  • 133
  • 372
  • 575
22
votes
8 answers

Calculate angle (clockwise) between two points

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…
Eric
  • 233
  • 1
  • 2
  • 6
21
votes
2 answers

Calculating X Y movement based on rotation angle?

Say I have an object in 2D space that can rotate and then should move according to its rotation angle. For example: If angle is 0(pointing upwards), then on_timer it should move 1 by Y and 0 by X. If angle is 45, then it should move 1 by Y and 1…
Rob
  • 593
  • 3
  • 6
  • 13
21
votes
3 answers

Determine angle of view of smartphone camera

I'm trying to determine the degree size of the field-of-view of a Droid Incredible smartphone's camera. I need to know this value for an application that I'm developing. Does anyone know how I can find out/calculate it programmatically?
GobiasKoffi
  • 3,754
  • 14
  • 54
  • 65
19
votes
8 answers

Fastest way to sort vectors by angle without actually computing that angle

Many algorithms (e.g. Graham scan) require points or vectors to be sorted by their angle (perhaps as seen from some other point, i.e. using difference vectors). This order is inherently cyclic, and where this cycle is broken to compute linear values…
MvG
  • 51,562
  • 13
  • 126
  • 251
18
votes
11 answers

Convert DD (decimal degrees) to DMS (degrees minutes seconds) in Python?

How do you convert Decimal Degrees to Degrees Minutes Seconds In Python? Is there a Formula already written?
David
  • 181
  • 1
  • 1
  • 4
17
votes
1 answer

How to calculate in JavaScript angle between 3 points?

I want to get angle between 3 points in JavaScript. If I have points A(x1,y1), B(x2, y2) and C(x3, y3), I want to get angle that is formed with lines AB and BC. let A = {x:x1, y:y1}, B = {x:x2, y:y2}, C = {x:x3, y:y3}
DejanG
  • 495
  • 1
  • 11
  • 15
15
votes
8 answers

Inner angle between two lines

I have two lines: Line1 and Line2. Each line is defined by two points (P1L1(x1, y1), P2L1(x2, y2) and P1L1(x1, y1), P2L3(x2, y3)). I want to know the inner angle defined by these two lines. For do it I calculate the angle of each line with the…
osanchezmon
  • 524
  • 1
  • 4
  • 18
15
votes
2 answers

XNA 2D vector angles - what's the correct way to calculate?

what is in XNA in 2D the standard way vector angles work ? 0 degrees points right, 90 points up, 180 left, 270 down ? What are the 'standard' implementations of float VectortoAngle(Vector2 vec) and Vector2 AngleToVector(float angle) so that…
Led
  • 1,872
  • 4
  • 21
  • 31
14
votes
1 answer

calculating angle between two points on edge of circle Swift SpriteKit

How would you calculate the degrees between two points on the edge of a circle in Swift.
PoKoBros
  • 631
  • 3
  • 9
  • 25
13
votes
1 answer

Rotate marker based on driving direction

I have a marker in my Google Maps map that looks like this: When the user is driving, I want to rotate it based on his driving direction. How can I achieve this? I should probably use previous location and current location coords for calculation,…
Gintas_
  • 4,483
  • 10
  • 36
  • 74
13
votes
2 answers

Mask a circular sector in a numpy array

I have a code that slices a numpy array into a circle. I wish to recover only the values included in a certain range of angles from the circle and mask the array. For example: mask the original array with the (x,y) positions comprised between 0 and…
Guadancil11
  • 515
  • 1
  • 6
  • 16
13
votes
3 answers

How do I display an arrow positioned at a specific angle in MATLAB?

I am working in MATLAB and I'm stuck on a very simple problem: I've got an object defined by its position (x,y) and theta (an angle, in degrees). I would like to plot the point and add an arrow, starting from the point and pointing toward the…
Aurélien
  • 153
  • 1
  • 1
  • 6
1
2
3
85 86