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
12
votes
3 answers

Vector direction for gravity in a circular orbit

I am currently working on a project in C# where i play around with planetary gravitation, which i know is a hardcore topic to graps to it's fullest but i like challenges. I've been reading up on Newtons laws and Keplers Laws, but one thing i cannot…
Casper Bang
  • 793
  • 2
  • 6
  • 24
12
votes
2 answers

A faster but less accurate fsin for Intel asm?

Since the function fsin for computing the sin(x) function under the x86 dates back to the Pentium era, and apparently it doesn't even use SSE registers, I was wondering if there is a newer and better set of instructions for computing trigonometric…
user2485710
  • 9,451
  • 13
  • 58
  • 102
12
votes
2 answers

Is php deg2rad() equal to mysql radians()

Are these functions the same? If not, what is an appropriate php equivalent to mysql's radians()
JLeonard
  • 8,520
  • 7
  • 36
  • 36
12
votes
1 answer

how to extrude a path in 3d?

I'm trying to extrude a path in 3d. Nothing fancy yet, just following some points and using a regular polygon for 'tubing'. I'm using Processing for now to quickly prototype, but will later turn the code into OpenGL. My problem is rotating the…
George Profenza
  • 50,687
  • 19
  • 144
  • 218
12
votes
11 answers

Trigonometric functions on embedded system

sin and cos functions are slow and need a lot of resources to run on embedded systems. How does one calculate sin and cos functions in a more resource-saving and faster way?
Victor
12
votes
2 answers

Rotate line around center point given two vertices

I've been trying to rotate a bunch of lines by 90 degrees (that together form a polyline). Each line contains two vertices, say (x1, y1) and (x2, y2). What I'm currently trying to do is rotate around the center point of the line, given center points…
adchilds
  • 963
  • 2
  • 9
  • 22
12
votes
3 answers

How to plot N points on the surface of a D-dimensional sphere roughly equidistant apart?

Let's say I have a D-dimensional sphere with center, [C1, C2, C3, C4, ... CD], and a radius R. Now I want to plot N number of points evenly distributed (equidistant apart from each other) on the surface of the sphere. It doesn't matter where those…
Dane Iracleous
  • 1,659
  • 2
  • 16
  • 35
11
votes
4 answers

Conversion from radians to degrees

I am trying to do a simple trigonometric calculation in C++. The following is an example of the problem I am having with this. As far as I know, C++ works in radians, not degrees. So conversion from radians to degrees should be a simple case of…
Matt
  • 251
  • 2
  • 3
  • 6
11
votes
7 answers

Math.Cos & Math.Sin in C#

I'm trying something that I thought should be reasonably simple. I have an angle, a position and a distance and I want to find the X,Y co-ordinates from this information. With an example input of 90 degrees I convert the value to radians with the…
elaverick
  • 314
  • 1
  • 2
  • 13
11
votes
9 answers

How to calculate the angle of a vector from the vertical?

Im trying to find out the angle (in degrees) between two 2D vectors. I know I need to use trig but I'm not too good with it. This is what I'm trying to work out (the Y axis increases downward): I'm trying to use this code at the moment, but it's…
Niall
  • 757
  • 3
  • 9
  • 17
11
votes
1 answer

sin(x) only returns 4 different values for moderately large input on GLSL fragment shader, Intel HD4000

I have a simple OpenGL 3.3 fragment shader written in GLSL. Essentially, I'm evaluating sin(x) for moderately large x (between 10,000 and 2,000,000), something like this: #version 330 out vec4 fColor; void main() { fColor = vec4(sin(gl_FragCoord.x…
Artificial Mind
  • 945
  • 6
  • 19
11
votes
6 answers

Find the Angle between two Bearings

Given two bearing, how do I find the smallest angle between them? So for example if 1 heading is 340 degrees and the second is 10 degrees the smallest angle will be 30 degrees. I've attached a picture to show what I mean. I've tried subtracting one…
Adam Davies
  • 2,742
  • 4
  • 33
  • 52
11
votes
4 answers

Rotate normal vector onto axis plane

I have a set of data points in 3D space which apparently all fall onto a specific plane. I use PCA to compute the plane parameters. The 3rd component of PCA gives me the normal vector of the plane (weakest component). What I want to do next is to…
ypnos
  • 50,202
  • 14
  • 95
  • 141
10
votes
5 answers

How to get coordinates of a point in a coordinate system based on angle and distance

How to get coordinates of a point in a coordinate system when all I have is the origin coordinates (x, y) and the angle from the origin to the point and the distance from the origin to the point?
just_user
  • 11,769
  • 19
  • 90
  • 135
10
votes
3 answers

HTML5 Canvas: Calculating a x,y point when rotated

I developing a HTML5 Canvas App and it involves reading a xml file that describes the position of arrows, rectanges and other shapes I need to to draw on the canvas. Example of the XML layout:
sazr
  • 24,984
  • 66
  • 194
  • 362