Questions tagged [geometry]
This challenge is intended to be solved by using, manipulating, or creating shapes or other geometric structures.
397 questions
-4
votes
3
answers
350
views
Render a polygon...in ASCII [closed]
Given the anti-clockwise points of a properly formed, non-self-intersecting, not-necessarily-convex polygon, render it as a filled ASCII art polygon.
Input
A series of at least 3 (x,y) pairs ...
16
votes
7
answers
1k
views
Solve the crossed ladders problem
I'm surprised we don't have the crossed ladders problem as a task here yet.
Two ladders of lengths a and b lie oppositely across an alley, as shown in the figure. The ladders cross at a height of h ...
18
votes
13
answers
1k
views
Make the Stars Shine
We've been given a map of the night sky. The map features three single characters, to match the theme, I'll refer to them O, X ...
9
votes
2
answers
346
views
Putting the pieces together
In this code-golf challenge, you will count the number of ways of putting together pieces of a building toy which consists of slotted squares that interlock with one another, shown below. In ...
8
votes
1
answer
253
views
How many polygons overlap?
Write a program or function which, given 1 or more polygons, determines the greatest number of polygons overlapping at a single point. That is, if each polygon was a piece of paper positioned ...
9
votes
1
answer
390
views
Ruler-and-compass constructions
In this code-golf challenge, you will work with a construction that was used by the ancient Greeks: the straightedge-and-compass construction. In particular, you will count how many different ...
1
vote
2
answers
315
views
minimum line queries in logarithmic time
Input
You are given 2 positive integers, n, q, followed by q queries. the queries can be of two forms:
0 a b: add the line a*x + b. a and b are integers between -...
12
votes
14
answers
1k
views
Generate the indices of the corners of the 12 face triangles of a cube
A cube has 6 faces. We can define it in terms of triangles only, by splitting each square face on the diagonal.
Each vertex of the cube is numbered 0 through 7. The coordinates of a vertex are that ...
9
votes
7
answers
574
views
Malfatti circle radii
Consider a triangle \$ABC\$ whose sides \$BC,CA,AB\$ have lengths \$a,b,c\$ respectively. In this triangle we can construct circles \$G_A,G_B,G_C\$ such that
\$G_A\$ is tangent to \$CA,AB,G_B,G_C\$
\$...
20
votes
6
answers
1k
views
Free Kei Friday
A kei (圭) is an algebraic structure that abstracts the idea of mirror reflections.
The kei is given as a set of mirrors \$X\$ and a closed reflection operation \$(\rhd) : X\times X\rightarrow X\$. We ...
12
votes
13
answers
1k
views
Determine the area of biggest rectangle containing exactly one "X"
Your input is a rectangular 2D char array, such as:
.X.......X
..........
.....X....
..X.......
........X.
.X........
..X.....X.
X.........
....X.....
Your goal is ...
6
votes
2
answers
384
views
Count the symmetries
Find the order (size) of the symmetry group of a finite set of integer points in d-dimensional space.
Input
You will be given the coordinates of a finite set of points in d-dimensional space, in any ...
7
votes
2
answers
355
views
Snake a string through a simplex
An n-simplex is a generalization of 'triangleness' in any dimension (specifically, it is the simplest shape requiring n dimensions). Starting with 0 dimensions, the named simplexes are: point, line ...
16
votes
10
answers
1k
views
Draw a Regular Reuleaux Polygon
Related: Draw A Reuleaux Triangle!, Draw a regular polygon
A Reuleaux polygon is a curve of constant width made up of circular arcs of constant radius. The most well-known Reuleaux polygon is the ...
12
votes
1
answer
488
views
Plot the ground path of a satellite
If you model a satellite as a free point orbiting a body, you can pretty easily see it has 6 degrees of freedom: three for the X, Y, and Z position, and three for the X, Y, and Z velocity. However, ...