I have angles that form a complete turn in an array x, from -90 to 270 e.g. (it may be defined otherwise, like from 0 to 360 or -180 to 180) with step 1 or whatever. asin function is valid only between -90 and +90. Thus, angles < -90 or > 90 would b

I have code where you give the 2 points a(x1,y1) and b(x2,y2) so that it calculates the angle between (alpha) them as shown in the image below: I tried using this: angle = math.degrees(math.atan2((x1 - x2),(y1 - y2))) to calculate the angle but it wo

I'm sorry if this question seems a really basic, but I cannot find a good answer online yet. I'm a little confused with vectors and how to use them in matlab. At the moment I have the following three pair of coordinates (x and y): Person 1, The futur

I am trying to get ANGLE working in C# using P/Invoke. Basically, I am creating a simple 2D surface, and then passing that off to skia (using SkiaSharp). Everything is working and all that, but I am having a problem marshalling PropertySet to the unm

I have 2 points in an x, y plane. I want to rotate one point onto the other point by rotating it about the z-axis. How can I find the angle to rotate one point onto the other?Well, the sin of this angle is [a, b] / (abs(a) * abs(b)) and its cos is (a

I followed a tutorial to be able to rotate the view in my OpenGL game with the mouse. I have to admit that I copy-and-pasted without really understanding and that's what I got... The direction of the camera is computed by the yaw and the pitch: direc

I'm kinda confused with this one. I have an object and I know it's velocities on axis x and y. My problem is how to determine the angle at which it's moving. function Object(){ this.velocity = {x: 5, y:1}; } Basically I Know that a vector's direction

Okay, straight to the point I'm working on a game engine in C++ using SDL and openGL with lua scripting and I need to get the angle of the analog stick to determine the direction of the 2d gun using this lua code playerLookArrow.rotation = math.atan(

Hi and thanks for reading. I need to change this void I wrote so that it can work with negative angles. The goal of this function is to rotate an ANGLE towards the DIRECTION by adding INCREMENT to either clockwise or counterclockwise (+ or -). Howeve

I have a 3D unit quaternion = {w,x,y,z} coming from a sensor device. I want to get the amount of angles(ax,ay,az) about X, Y and Z axes ( But the angles should be independent, one should not change when the other changes). I have come across, Quatern

Ok, I am supposed to calculate the angle of a right triangle using Java. The measurements of the sides are a = 3 and b = 4 with the hypotenuse being c = 5. If I use Math.sin, it does not calculate the angle created by a and c. Is there another Math f

In above image there is one white line, I want to animate this image in the circle only as per angle. Suppose if my angle is 20 degree then that white line animate in 58 degree, and it will come like following image Her is my code UIImageView *imgBen

I need to be able to move my player x and y pixels in the same direction as a point to a point. It's hard to explain, but this is what I am trying to do: Angles 1 and 2 have to be the same. Point 1 stays the same at (100, 100), however point 2 consta

I want to find out the clockwise angle between 2 vectors(2D, 3D). The clasic way with the dot product gives me the inner angle(0-180 degrees) and I need to use some if statements to determine if the result is the angle I need or its complement. Do yo

Does anyone know how to get an angle between two points when 0 degree reference is up (at 12 o'clock)? I'm using two sets of (x,y) points for atan2() for that but it returns 0 degree at 3 o'clock.Atan2() returns the counterclockwise angle from the po

For the past year or so I've been familiarizing myself with Javascript, and in an attempt to really learn the language thoroughly I decided to make an HTML5 game! The problem i've run into is that I have absolutely no idea how to move an image across

what I want to do is the following: I have an object (blue point) and I want to point it to other object no matter where it is located around it (green point). So I need to know the angle between these two objects to do what I want right? http://s13.

I've got a little Problem with the Math.cos() method. I know, I have to convert the angle to Radians before using Math.cos(). But if I just do: System.out.println(Math.cos(Math.toRadians(90)); It outputs: 6.123233995736766E-17 Math.sin() is working w

I apologize for the ambiguous title, but I am not entirely sure how to phrase this one. So bear with me. I have a matrix of data. Each column and row represents a certain vector (column 1 = row 1, column 2 = row 2, etc.), and every cell value is the

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 t

I want to write some radian angles to a binary file. Is there any way I can save space while doing so? I considered converting them to degrees and writing them out as a short but when converting to a short they loose their fractional part so that was

Is it possible to set the rectangle angle property in C#? I tried this: Rectangle r = new Rectangle(); r.Width = 5; r.Height = 130; r.Fill = Brushes.Black; r.RotateTransform.AngleProperty = 30; // Here is the problem canvas1.Children.Add(r); One way

I am rotating points around a center point in 2D space. The points are the center point, the old mouse position, and the new mouse position. My rotation function works fine, and I can calculate the angle perfectly. But I want to calculate a negative

This should be a simple matter, but for some reason I can't grasp it. I have a parallelogram, defined as four points (in anti-clockwise order, but apart from that I do not know which corner is which). I also have the center point of the parallelogram

I would like to know whether it is possible or not to create text in a web page at an angle, for example at 40 Degrees. If it is possible, how can I do this? EDIT: Finally, I decided to go with Mathias Bynens's answer.To add to Mathias' answer, you c

I was given this interview question recently: Given a 12-hour analog clock, compute in degree the smaller angle between the hour and minute hands. Be as precise as you can. I'm wondering what's the simplest, most readable, most precise algorithm is.

I want to calculate the angle between two vectors a and b. Lets assume these are at the origin. This can be done with theta = arccos(a . b / |a| * |b|) However arccos gives you the angle in [0, pi], i.e. it will never give you an angle greater than 1

I have my current location from CLLocation, and I have another location- also an CLLocation. I would like to detect when my device is heading towards that other location. (I can calculate the distance in meters between this points- but can't workout

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 radians. Mathematic

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 directi