The 2024 Developer Survey results are live! See the results

# Questions tagged [geometry]

This challenge is intended to be solved by using, manipulating, or creating shapes or other geometric structures.

383 questions
Filter by
Sorted by
Tagged with
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 ...
• 8,752
377 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, ...
• 1,073
346 views

### Find the most isolated point

Given two non-empty sets of points $P,T = \{(x,y)\ |\ x,y \in \mathbb{Z} \}$, find the point $p \in P$ such that it is the "most isolated" from all points in $T$. The "most ...
• 10.3k
481 views

### How far are you?

Write a program that gets coordinates of two objects on Earth, and calculates how far they are from each other directly in space (a straight line through Earth) and on the surface (through the ...
574 views

### Construct the point with two segments

Given a rational point P, return four integral points A, B, C, and D, such that the line segments AB and CD intersect only at P. To make it a bit more interesting, segment AB doesn't include A and B. ...
• 25.5k
3k views

• 2,249
185 views

• 50.1k
279 views

### Construct the Constructability sequence

Consider compass-and-straightedge construction, where you can construct new points from existing ones by examining intersections of straight lines and circles constructed with one of the following two ...
• 50.1k
981 views

### Calculate the Distance to a Line Segment

The Challenge Given two vertexes and a point calculate the distance to the line segment defined by those points. This can be calculated with the following psudocode ...
• 10.9k
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 ...
• 4,050
424 views

### Generate the vertices of a geodesic sphere

As in this challenge, the task is to generate the vertices of a polyhedron. The polyhedron here is the one obtained by dividing a regular icosahedron's triangular faces into smaller triangles so that ...
• 621
2k views

### Vertices of a regular dodecahedron

A regular dodecahedron is one of the five Platonic solids. It has 12 pentagonal faces, 20 vertices, and 30 edges. Your task is to output the vertex coordinates of a regular dodecahedron. The size, ...
• 49k
1k views

### Euclidean distance on projective plane

Motivated by this challenge Background Let we have a square sheet of flexible material. Roughly speaking, we may close it on itself four ways: Here the color marks the edges that connect and the ...
• 3,413
4k views

### Given 4 fence lengths, what's the largest rectangular yard you can make?

Here's a very simple little problem that I don't believe has been asked before. Challenge Write a program or a function that takes in four positive integers that represents the lengths of movable but ...
• 809
2k views

### Calculate Euclidean distance on a torus

Euclidean distance between two lattice points $(x_1, y_1)$ and $(x_2, y_2)$ on a plane is: $\sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}$. Imagine now a lattice ...
• 13.7k
598 views

### Enumeration of free polyominoes

A polyomino with $n$ cells is a shape consisting of $n$ equal squares connected edge to edge. No free polyomino is the rotation, translation or reflection (or a combination of these ...
• 9,408
2k views

### Draw the GKMS aperiodic tile

Chaim Goodman-Strauss, Craig Kaplan, Joseph Myers and David Smith found the following simple (both objectively and subjectively) polygon that tiles the plane, but only aperiodically: Indeed they ...
• 3,845
1k views

### Detect round trips on a hyperbolic grid

You're driving a car in an infinite city whose blocks are pentagons arranged in the order-4 pentagonal tiling. At each step, you proceed to the next intersection and choose whether to continue left, ...
• 621
631 views

### Voronoi-Lloyd ASCII art [closed]

Voronoi diagram is a partition of a plane (or part of plane) into regions close to each of a given set of objects ("seeds"). Here we’ll be dealing with discrete arrays or even rather with ...
• 3,413
278 views

### Canonical form of a cubic Bézier curve

On Pomax's Primer on Bézier Curves this "fairly funky image" appears: This is related to the fact that every cubic Bézier curve can be put in a "canonical form" by an affine ...
• 3,845
208 views

### 4D rotation matrix to quaternions

It is well-known that a 3D rotation can always be represented by a quaternion. It is less well-known that a 4D rotation can always be represented by two quaternions, sending a point $p=(a,b,c,d)^T$ ...
• 3,845
480 views

• 17.5k
2k views

### The Area of Rectangles

Getting the area covered by a rectangle is really easy; just multiply its height by its width. However in this challenge we will be getting the area covered by multiple rectangles. This is equally ...
• 99.3k
910 views

### Find the sliced sheet of paper

Context : Suppose you have a sheet of paper measuring 8 x 10. You want to cut it exactly in half while maintaining its rectangular shape. You can do this in two ...
573 views

### Draw me a shape

The game shapez.io has a lot of shapes. In my previous challenge, the object was to generate a random code for a shape. Now, your challenge is to render a shape. Specs Shapes Each shape has a unique ...
• 39.6k