Questions tagged [physics]
For challenges pertaining to problems in the field of Physics.
39 questions
22
votes
48
answers
4k
views
Parallel resistance in electric circuits
Introduction:
Two resistors, R1 and R2, in parallel (denoted R1 || R2) have a combined ...
40
votes
13
answers
5k
views
Recreate Minecraft's lighting
Minecraft has a fairly unique lighting system. Each block's light value is either one less than the brightest one surrounding it, or it is a light source itself. Your task is to write a method that ...
37
votes
35
answers
5k
views
Draw the arc of a ball
Draw the parabolic trajectory of a thrown ball.
The input is the ball's initial upward velocity, a positive integer v. Every second, the ball moves ...
106
votes
16
answers
6k
views
Simulate the Universe!
One nice property of a Turing-complete language is that it can be used to write any program, up to and including the simulation of the entire Universe.
Your job is to do exactly that: write a program ...
13
votes
12
answers
3k
views
Simulate the ripple effect
Imagine throwing a rock into a pond. You get to see perfect circles of ripples spreading out over the pond, bouncing off of each other. Of course, nothing can be as serene as that in coding, but, we ...
22
votes
14
answers
3k
views
Elastic collisions between blocks
The 3Blue1Brown Youtube channel released a video a year ago called "Why do colliding blocks compute pi?" which describes a model where a block A of mass \$a\$ ...
18
votes
10
answers
2k
views
Position from atomic number in the periodic table
Let us consider the following representation of the periodic table.
...
24
votes
22
answers
2k
views
Can this list be balanced?
To check whether a list of non-negative integers is balanced, one can imagine putting respective weights on a board and then try to balance the board on a pivot such that the summarized relative ...
12
votes
27
answers
2k
views
Calculate the relativistic velocity
In special relativity, the velocity of a moving object relative to another object that is moving in the opposite direction is given by the formula:
\begin{align}s = \frac{v+u}{1+vu/c^2}.\end{align}
<...
39
votes
16
answers
3k
views
Will I tip over?
Overview
Given a 3 line string, figure out if the structure falls to the left, balances, or falls to the right.
Input structure
You can imagine the structure as metal rod with stuff on top, all being ...
46
votes
19
answers
5k
views
Lever Simulator 2015
Why a Simulator?
Kids these days don't have the time nor the ambition to actually go and stack boxes on the see-saw or play around with balancing physical objects. This leaves lots of room in the ...
20
votes
13
answers
2k
views
Convert Planck unit to SI metric
Objective
Given a dimension of an SI unit, convert the Lorentz-Heaviside version of a Planck unit \$1\$ into SI metric.
What is a Planck unit?
Planck units are a set of units of measurement. It ...
29
votes
8
answers
6k
views
Billiard balls collision
Given the 2-dimensional positions and velocities of a pair of billiard balls right before impact, calculate their velocities after a perfectly elastic collision. The balls are assumed to be ideal ...
19
votes
10
answers
5k
views
What do I need to destroy the world?
The gravitational binding energy of a planet is the amount of energy required to separate every tiny piece of it so that no piece will orbit or collide with another piece. For a uniform sphere, ...
19
votes
10
answers
1k
views
How far is the Sun?
Introduction
tl;dr
Continuously output the current distance from the Earth to the Sun.
Simplified, the orbit of the Earth around the Sun is an ellipse. So the actual distance between both is ...