Questions tagged [trigonometry]
For challenges where trigonometry plays an important role.
37 questions
9
votes
4
answers
224
views
Finding Chord Segments with Integer Length
A math teacher wants to give his students an interesting geometry problem.
He has the following idea (Fig. 1):
Let \$AB\$ and \$CD\$ be two chords of a circle with center \$M\$, intersecting
...
9
votes
8
answers
1k
views
Inverse trigonometric functions
There are 3 (commonly used) trigonometric functions sin cos and tan each of these functions ...
20
votes
9
answers
2k
views
Cutting a Circular Pizza Vertically
Most people would cut circular pizzas into circular sectors to divide them up evenly, but it's also possible to divide them evenly by cutting them vertically like so, where each piece has the same ...
15
votes
9
answers
1k
views
Ptolemy's table of chords
Ptolemy's Almagest contains a table of chords that effectively served as the world's only comprehensive trigonometric table for over a millennium. In modern form it looks like this:
\begin{array}{|l|...
2
votes
0
answers
361
views
Compute the Three Dimensional Discrete Cosine Transform
Challenge
I've checked that there is a question Compute the Discrete Cosine Transform which is a competition for implementing a shortest solution to compute the one dimensional discrete cosine ...
12
votes
10
answers
2k
views
Integers in cosine
Integers in cosine
From trigonometry we know that
\$\sin(a) =-\cos(a + \frac{(4*m + 1)\pi}{2})\$
where \$a\$ is an angle and \$m\in\mathbb{Z}\$ (integer).
The task
For an input of a positive integer \$...
25
votes
11
answers
2k
views
Perimeter of Conway hexagon
Background
Given a triangle \$ABC\$, extend its three sides by the opposite side length, as shown in the figure below. Then the six points surprisingly lie on a circle called the Conway circle, whose ...
25
votes
14
answers
3k
views
Are my triangles similar?
Given (in any structure; flat list, two lists of lists, a tuple of matrices, a 3D array, complex numbers,…) the coordinates for two non-degenerate triangles ...
33
votes
15
answers
4k
views
Black Box Trigonometry
Write a program or function that can distinguish the following 12 trigonometric functions: sin,
cos,
...
14
votes
21
answers
3k
views
Distance between two points on the Moon
Given latitude/longitude of two points on the Moon (lat1, lon1) and (lat2, lon2), compute the distance between the two points in ...
22
votes
2
answers
851
views
Expand Sine and Cosine
Trigonometry has LOTS of identities. So many that you can expand most functions into sines and cosines of a few values. The task here is to do that in the fewest bytes possible.
Identity list
Well, ...
26
votes
25
answers
3k
views
Approximate the Dottie number to arbitrary precision
The Dottie number is the fixed point of the cosine function, or the solution to the equation cos(x)=x.1
Your task will be to make code that approximates this constant. Your code should represent a ...
6
votes
7
answers
757
views
Solve sin(θ) = x in the range a ≤ θ ≤ b
Challenge
Given a number, x where -1 ≤ x ≤ 1, and the integers a and ...
4
votes
8
answers
725
views
Compute the Discrete Cosine Transform
Implement the Discrete Cosine Transform (DCT). This may implemented as either a function or a program and the sequence can be given as either an argument or using standard input. Your program must be ...
2
votes
18
answers
2k
views
Find the coterminal angle on [0, 2π)
This challenge is very simple:
Given an angle measure in degrees or radians (your choice), output the angle between 0 and 2π non-inclusive [0º, 360º) that is coterminal with it.
Input
A positive ...