angle

Annuity or Angle Operation Symbol in LaTeX

How do I set the symbol for the angle or annuity operation in LaTeX? Specifically, this is the actuarial a angle s = (1-vs)/i. ...

How do you calculate the angle between two normals in glsl?

How do you calculate the angle between two normals in glsl? I am trying to add the fresnel effect to the outer edges of an object (combining that effect with phong shading), and I think that the angle is the only thing I am missing. Fragment Shader: varying vec3 N; varying vec3 v; void main(void) { v = vec3(gl_ModelViewMatrix * gl_V...

Rotating an image in all browsers (canvas in IE?)

I finally got to work with canvas only to find out that it is not implemented in IE. I tried explore canvas from google to use it in Internet Explorer, but it's not working for my code (http://uptowar.com/test.php - little bug though that it is not removing the old image when rotating). So, is there an other way to smoothly rotate an im...

Math (in WPF): Getting new x,y coordinates after a translation

With reference to this programming game I am currently building. I am using WPF to animate canvases, and I am using the BeginAnimation method to translate (move) a canvas across another canvas. With the BeginAnimation, I need to specify the From and To coordinates for both x and y, and this is the method I am using this like such: //X...

Math help - Can't rotate something (knowing Java would be a plus)

Okay I'm trying to rotate a Java Polygon based on it's original position of angle 0. x, and y end up being converted to an int at the end of me using them, so I could understand not seeing some change, but when the difference in angles is big like 0 to 180 I think I should see something. I've been at this for a little while and can't t...

Calculating point on a circle's circumference from angle in C#?

I imagine that this is a simple question, but I'm getting some strange results with my current code and I don't have the math background to fully understand why. My goal is simple, as stated in the title: I just want to find the point at some distance and angle from a center point. My current code: Point centerPoint = new Point ( 0, 0...

how to determine polygon rotation angle

I am writing a program (.net) to create a stadium style layout and need to determine the angle of rotation for each polygon compared to the horizontal. This is so i can construct the contents of the polygon and also rotate this correctly to fit inside. Given the below image as an example to simulate each variant of the facing direction...

How to determine whether V3 is between V1 and V2 when we go from V1 to V2 counterclockwise?

I have three vectors V1, V2, and V3. Their origin points are on the axes' origin. How could I determine whether V3 is between V1 and V2 when I move around counterclockwise from V1 to V2? It can't be done with obtaining their angles and evaluating these kind of conditions (pseudo-code): if angle(V3) > angle(V1) && angle(V3) < angle(V2...

How to find Angle of Rotation of iphone?

Hi to all I want to calculate angle of rotation when I am rotating the iphone from portrait mode to Landscape right or Landscape left but in YX plane. In my game I want to rotate one object respect to iphone but in opposite direction. If I will move iphone from portrait mode to Landscape right by 30 degree then I want to move object 30 ...

Rotate a point by an angle

I want to know how to work out the new co-ordinates for a point when rotated by an angle relative to another point. I have a block arrow and want to rotate it by an angle theta relative to a point in the middle of the base of the arrow. This is required to allow me to draw a polygon between 2 onscreen controls. I can't use and rotate a...

How to parse angular values using regular expressions

Hi, I have very little experience using regular expressions and I need to parse an angle value expressed as bearings, using regular expressions, example: "N45°20'15.3"E" Which represents: 45 degrees, 20 minutes with 15.3 seconds, located at the NE quadrant. The restrictions are: The first character can be "N" or "S" The last charac...

plot line at particular angle and offset

I'm attempting to plot a particular line over an original image (an array) that i have. Basically, I have an angle and offset (measured from the center of the image) that I want to plot the line over. The problem is, I'm not exactly sure how to do this. I can write a really complicated piece of code to do this, but I'm wondering if there...

Given an angle and dimensions, find a coordinate along the perimeter of a rectangle

I'm writing a script where icons rotate around a given pivot (or origin). I've been able to make this work for rotating the icons around an ellipse but I also want to have them move around the perimeter of a rectangle of a certain width, height and origin. I'm doing it this way because my current code stores all the coords in an array ...

How to calculate a point on a rotated axis?

How can I calculate a point (X,Y) a specified distance away, on a rotated axis? I know what angle I'd like the point "moving" along (in degrees). ...

Average of two angles with wrap around

Possible Duplicate: How do you calculate the average of a set of angles? I have two angles, a=20 degrees and b=350 degrees. The average of those two angles are 185 degrees. However, if we consider that the maximum angle is 360 degrees and allows for wrap around, one could see that 5 degrees is a closer average. I'm having trou...

Calculate rotations to look at a 3D point?

I need to calculate the 2 angles (yaw and pitch) for a 3D object to face an arbitrary 3D point. These rotations are known as "Euler" rotations simply because after the first rotation, (lets say Z, based on the picture below) the Y axis also rotates with the object. This is the code I'm using but its not working fully. When on the groun...

How do I determine whether a number is within a percentage of another number

I'm writing iPhone code that fuzzily recognizes whether a swiped line is straight-ish. I get the bearing of the two end points and compare it to 0, 90, 180 and 270 degrees with a tolerance of 10 degrees plus or minus. Right now I do it with a bunch of if blocks, which seems super clunky. How to write a function that, given the bearing 0...

Programming a smooth change of thrust from current velocity vector to a target vector.

TL;dr: "I am not sure how to calculate a smooth transition of thrust between one vector and another." I am programming a simple game where an enemy chases after the player in an open space (no walls). I was calculating the enemy's x & y velocities independently, accelerating them if they were taking them in the direction of the player a...

Flipping an angle horizontally

I want to know a way to flip an angle in a horizontal axis, without having to do many operations. Say I have an angle of 0 ("pointing right" in my code's coordinate system), the flipped angle should be 180 (pointing left). If 90 (pointing up), flipped it should still be 90. 89 is 91, and so on. I can operate on the X/Y speeds implied by ...

Global angle of 3d vectors

I have 3 Vectors, Up Right and Front that represent a direction. I need to convert these into an XYZ angle (3 floats) so i can use with glRotatef() Please help [EDIT] Its not rendering properly. can you see if its anything blatant here: pastebin.com/f6683492d ...