Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Commit fd09182

Browse files
committed
fix: clarify lights
1 parent 8557974 commit fd09182

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

competition/lights/prob.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ difficulty = 1
1313

1414
# 💡 Point Source Lights
1515

16-
Given the 3D positions and RGB hexcodes of several point light sources, find the colour at 0, 0, 0. The light strength falls off at `1/(r^2)` where `r` is the distance to the light source. The colours from each light are then summed. There is no occlusion.
16+
Given the 3D positions and RGB hexcodes of several point light sources, find the colour at 0, 0, 0. The light strength falls off at `I_attenuated = I_original / (r^2)` where `r` is the distance to the light source, `I_original` is the full intensity of the light and `I_attenuated` is the strength at a distance `r`. The colours from each light are then summed. There is no occlusion.
1717

1818
## Input Format
1919
Each line of the input represents a light source. Each line contains a hexcode (with hash) followed by 3 numbers representing the position all separated by spaces. For example:
@@ -25,3 +25,7 @@ Hexcodes are in the format `#RRGGBB` where `RR`, `GG`, and `BB` are two-digit he
2525

2626
## Output Format
2727
Your output should be a hexcode (with or without hash) of the colour at the origin. **There is a ±1 margin of error on each component.** If a component of the solution saturates, just use `ff` for that component.
28+
29+
## Clarifications
30+
* The length of a 3D vector `(x, y, z)` is `sqrt(x^2 + y^2 + z^2)`.
31+
* To attenuate a colour, divide each of the R, G, and B components.

0 commit comments

Comments
 (0)