Questions tagged [trigonometry]
For challenges where trigonometry plays an important role.
9 questions
24
votes
29
answers
10k
views
Draw a regular polygon
The goal of this code golf is to draw a regular polygon (one with equal side lengths) given the number of sides and radius (distance from center to vertex).
The number of sides and the radius can be ...
17
votes
3
answers
612
views
Regular Polygrams
Given the number of vertices n ≥ 3 and the "step size" 1 ≤ m < n/2 (indicating the distance between two connected vertices), ...
6
votes
2
answers
659
views
Make a Surfin' Word
Your goal is to map a piece of text to a sine curve of the form:
a sin ( mx - b )
Where a and m are non-zero rational numbers, b is a rational number, and the calculations are in radians.
It doesn't ...
44
votes
47
answers
9k
views
A single pixel moving in a circular path
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
21
answers
6k
views
Draw a graph of \$y=(-n)^x\$
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 ...
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 ...
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 ...
10
votes
3
answers
2k
views
Help me with trigonometry!
Thank you guys so much for your help with calculus. Now I need some help with my upcoming trigonometry test.
On the test, I'll need to simplify expressions. I’ll be given input like ...
4
votes
6
answers
532
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 ...