Skip to main content

Questions tagged [trigonometry]

For challenges where trigonometry plays an important role.

9 votes
4 answers
224 views

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 ...
47 votes
52 answers
10k views

This is a graphical output challenge where the task is to give the shortest code per language. Task Your code should plot a single purple pixel (hex value #800080 or rgb(128, 0, 128)), moving ...
36 votes
45 answers
6k views

My boss just told me to write a cosine function. Being a good math geek, my mind immediately conjured the appropriate Taylor Series. $$\cos(x) = \frac 1 {0!} - \frac {x^2} {2!} + \frac {x^4} {4!} - \...
4 votes
8 answers
725 views

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 ...
26 votes
25 answers
3k views

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 ...
9 votes
8 answers
1k views

There are 3 (commonly used) trigonometric functions sin cos and tan each of these functions ...
36 votes
22 answers
6k views

Challenge Given an input of an integer, \$n\$ (where \$0<n<50\$), output the graph of \$y=\mathrm{Re}((-n)^x)\$ from \$x = -3\$ to \$x = 3\$ inclusive. Where \$\mathrm{Re}(p)\$ is the real part ...
33 votes
15 answers
4k views

Write a program or function that can distinguish the following 12 trigonometric functions: sin, cos, ...
14 votes
18 answers
3k views

Given two points A and B, find the angle from line AO to line ...
22 votes
2 answers
851 views

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, ...
21 votes
18 answers
5k views

Introduction: The sine of \$x\$ is given by the formula: $$\sin(x) = x - \frac {x^3}{3!} + \frac {x^5}{5!} - \frac {x^7}{7!} + \frac {x^9}{9!} - \frac {x^{11}}{11!} + \cdots$$ The cosine of \$x\$ is ...
16 votes
9 answers
4k views

Introduction The two most common trigonometric functions, sine and cosine (or sin and ...
20 votes
9 answers
2k views

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 ...
23 votes
3 answers
932 views

Here's a deceptively challenging geometry puzzle for you! Given a circle A, and n other circles ...
15 votes
9 answers
1k views

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

15 30 50 per page