Questions tagged [trigonometry]

Trigonometry is a branch of mathematics that studies triangles and the relationships between their sides and the angles between sides

Trigonometry is a branch of mathematics that studies triangles and the relationships between their sides and the angles between sides. Trigonometry defines the trigonometric functions, which describe those relationships and have applicability to cyclical phenomena, such as waves.

Trigonometry can be implemented into many programming languages, such as python. Trigonometry can be used to find an angle in a triangle using the side lengths etc.

References:

3369 questions
8
votes
5 answers

Vectorized Trig functions in C?

I'm looking to calculate highly parallelized trig functions (in block of like 1024), and I'd like to take advantage of at least some of the parallelism that modern architectures have. When I compile a block for(int i=0; i
Jeremy Salwen
  • 8,061
  • 5
  • 50
  • 73
8
votes
1 answer

Rotate rectangle around a point

How would I get 4 points rotated a certain degrees around a pointer to form a rectangle? I can rotate a point around a point, but I can't offset it to make a rectangle that isn't distorted.
Anonymous
  • 1,823
  • 7
  • 23
  • 29
8
votes
1 answer

iphone compass rotating based on orientation

Hi i am looking to be pointed in the right direction in solving a problem that when the orientation of the iphone is changing/changes what transformations will need to be performed on didUpdateHeading:newHeading to make the value of…
chicken
  • 1,618
  • 5
  • 24
  • 35
8
votes
4 answers

Find corners of a rotated rectangle given its center point and rotation

Can someone give me an algorithm that finds the position of all four corners of a rectangle if I know its center point(in global coordinate space), width and height, and its rotation around that center point? clarification edit: The width and height…
Chris Hansen
  • 315
  • 1
  • 3
  • 12
8
votes
7 answers

Determining if a lat-long rect and a circle on a sphere overlap

Suppose I have the following: A region defined by minimum and maximum latitude and longitude (commonly a 'lat-long rect', though it's not actually rectangular except in certain projections). A circle, defined by a center lat/long and a radius How…
Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
8
votes
2 answers

acos(1) returns NAN in some conditions

Here's my code:
Victor Marchuk
  • 13,045
  • 12
  • 43
  • 67
8
votes
4 answers

SVG Draw a circle with 4 sectors

I need to draw a circle with 4 sectors. I'm trying to draw a sector like this: I got the -127.27, 127.27 from the equations: x=cos(angle) * radius y=sin(angle) * radius My angle is…
Ivan
  • 16,536
  • 6
  • 23
  • 36
8
votes
3 answers

sin v/s sinf function in C

I am trying to use the sinf function in my C Program but it gives me an undefined reference error under MSVC 6.0, however sin works fine. This make me curious to find the difference between sin and sinf. What is the logical difference between sin…
Viks
  • 760
  • 4
  • 12
  • 26
8
votes
2 answers

How do I calculate the angle of a right triangle using the Javascript Math library?

Consider the following triangle : I want to calculate angle X I have the following : var opposite = 2.5; var hypotenuse = 5; var sinOfAngleX = opposite / hypotenuse; // 0.5 So now I know that Math.sin(valueofAngleX) would return…
Kawd
  • 4,122
  • 10
  • 37
  • 68
8
votes
3 answers

calculating intersection point of quadratic bezier curve

This is definitely pushing the limits for my trig knowledge. Is there a formula for calculating an intersection point between a quadratic bezier curve and a line? Example: in the image below, I have P1, P2, C (which is the control point) and X1, X2…
tyler mackenzie
  • 622
  • 7
  • 18
8
votes
3 answers

Angle between two 2d vectors, diff between two methods?

I've got this code snippet, and I'm wondering why the results of the first method differ from the results of the second method, given the same input? public double AngleBetween_1(vector a, vector b) { var dotProd = a.Dot(b); var lenProd =…
bitcycle
  • 7,632
  • 16
  • 70
  • 121
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
8
votes
9 answers

Calculate the cosine of a sequence

I have to calculate the following: float2 y = CONSTANT; for (int i = 0; i < totalN; i++) h[i] = cos(y*i); totalN is a large number, so I would like to make this in a more efficient way. Is there any way to improve this? I suspect there is,…
Federico
  • 576
  • 4
  • 20
8
votes
4 answers

How to get angle of point from center point?

If I have 2 points (x0,y0) which is the center of the circle, and another point (x,y) (this is the red dot on the circle boundary in the image). How can I get the angle of the dot? Note, it should return an angle in degrees, from [0,360). The red…
omega
  • 40,311
  • 81
  • 251
  • 474
8
votes
9 answers

Knowing two points of a rectangle, how can I figure out the other two?

Hey there guys, I'm learning processing.js, and I've come across a mathematical problem, which I can't seem to solve with my limited geometry and trigonometry knowledge or by help of Wikipedia. I need to draw a rectangle. To draw this rectangle, I…
icco
  • 3,064
  • 4
  • 35
  • 49