Questions tagged [degrees]

A unit of measurement for angles, which are two lines or rays diverging from a common point. Questions here regard angles measurements, arguments for trigonometric functions, geometry, etc.

264 questions
70
votes
5 answers

Why does OpenGL use degrees instead of radians?

The OpenGL designers were never afraid of mathematics, and knowledge of linear algebra is essential for all but the simplest OpenGL applications. I think it can safely be assumed that OpenGL programmers are familiar with angles in…
Thomas
  • 174,939
  • 50
  • 355
  • 478
68
votes
7 answers

Rotate point about another point in degrees python

If you had a point (in 2d), how could you rotate that point by degrees around the other point (the origin) in python? You might, for example, tilt the first point around the origin by 10 degrees. Basically you have one point PointA and origin that…
user2592835
  • 1,547
  • 5
  • 18
  • 26
56
votes
9 answers

Java: Calculating the angle between two points in degrees

I need to calculate the angle in degrees between two points for my own Point class, Point a shall be the center point. Method: public float getAngle(Point target) { return (float) Math.toDegrees(Math.atan2(target.x - x, target.y - y)); } Test…
Aich
  • 962
  • 2
  • 9
  • 19
53
votes
3 answers

Convert radians to degree / degree to radians

Are there build-in functions in R for the conversion of radians to degree and degree to radians? So far I wrote my one own functions: rad2deg <- function(rad) {(rad * 180) / (pi)} deg2rad <- function(deg) {(deg * pi) / (180)} #test: rad2deg(pi)…
Iris
  • 1,072
  • 3
  • 10
  • 22
35
votes
2 answers

swift trigonometric functions (cos, tan, arcsin, arcos, arctan)

hello I have to differenciate calculations in degrees and I have the following code but I doesn't return me the exact values. The only one right is the value of sin90 in degree = 1 //////***** DEGREES ******////// var sinus = sin(90.0 * M_PI /…
kepi
  • 377
  • 1
  • 3
  • 7
28
votes
4 answers

Calculating degrees between 2 points with inverse Y axis

I'm creating a simple 2D game in javascript/canvas. I need to figure out the angle of a certain object relative to my position. So: say I'm at (10,10) and the object is at (10,5) - that would result in 90 degrees (as positive Y is down, negative Y…
Jelle De Loecker
  • 20,999
  • 27
  • 100
  • 142
24
votes
15 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
  • 241
  • 1
  • 2
  • 4
20
votes
1 answer

map degrees to 0 - 360 in python

is it possible to map a value of rotation to be inside the range of 0-360 degrees? For example: a angle of -10° should be 350° a angle of 760° should be 40° degrees? Is there an easy solution? Maybe in mathutils? best, chris
Christoph Müller
  • 483
  • 1
  • 5
  • 16
19
votes
4 answers

degree symbol in TextView

I want to know how to make a degree symbol for an angle in a Text View (android). There are a few questions similar to this, I have tried them but they don't seem to work.
Jack Trowbridge
  • 3,175
  • 9
  • 32
  • 56
16
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
  • 701
  • 3
  • 9
  • 25
15
votes
1 answer

Convert an angle in degrees, to a vector

I'm doing some game programming. FWIW I'm using XNA, but I'm doubtful that this is relevant. I'd like to convert degrees to a directional vector (ie X and Y) with magnitude 1. My origin (0,0) is in the upper left. So I'd like 0 degrees to convert…
Rory Becker
  • 15,551
  • 16
  • 69
  • 94
12
votes
6 answers

Convert decimal coordinate into degrees, minutes, seconds, direction

I have the following so far, but can't figure out a tidy way to get the direction letters in without a bunch of messy if statements. Any ideas? Ideally I'd like to extend the CLLocation class with a category to do this. -(NSString…
trapper
  • 11,716
  • 7
  • 38
  • 82
10
votes
7 answers

Converting Degree, Minutes, Seconds (DMS) to decimal in PHP

Currently, I'm learning to use Google Maps API. From what I read, the API require the latitude and longitude in Decimal Degree (DD). In my database, the data is stored as DMS. Example, 110° 29' 01.1" I would to ask if you have any DMS to DD in PHP.…
Azlan Nohara
  • 129
  • 1
  • 1
  • 5
9
votes
1 answer

Three.js setFromRotationMatrix strange behavior when rotation is over 90 degrees

I have objects which each have a separate parent for each rotation axis (1 for X-rotation, 1 for Y-rotation, and 1 for Z-rotation. They are all related to each other in that order as well: X-rotation object is a child of the Y-rotation object.…
MrGarretto
  • 282
  • 4
  • 14
8
votes
4 answers

How to compute correctly rounded trigonometric functions in degrees?

How could I define trigonometric functions that take arguments in degrees instead of the usual radians, and compute correctly rounded results for these arguments? Multiplying the argument by M_PI/180.0 before passing it to the corresponding function…
Pascal Cuoq
  • 79,187
  • 7
  • 161
  • 281
1
2 3
17 18