Citadel Problem

Help Contents Examples Citadel Problem
Creatures (multiple inheritance) ClipCube (simple 3d)

Citadel Problem

Module:    Elica Geomland Extra Library
File name: GeomEx.eli
DLL name:  (no DLL)
Modified:  June 1, 2000
Author:    Bojidar Sendov
Version:   4.2
E-mail:    bojo@fmi.uni-sofia.bg

Copyright © 1999-2000 Elica Group

The "Citadel" problem:

Let us have a circle ("citadel") and a point ("gun") inside the circle. Imagine the "gun" is firing bullets and at the same time is rotating around its center.

What "locus of bullets" we will have if the bullets are reflecting when stuck to the "citadel" and stop on a path distance equal to the diameter of the "citadel"?

run "geomland
run "geomex

make "O point 0 0
make "r 100
make "cit circle :O :r
make "gun :O+(point :r*0.7 0)°(random 360) [labeled]

make [hidden] "l2
make [hidden] "c

make "d 50
repeat 73
[
	make "c pointon :cit :d
	make "l2 ray :c sympoint :gun line :O :c
	make "z pointon :l2 2*:r-(distance :gun :c) [traced]
	make "d :d+5
]

Creatures (multiple inheritance) ClipCube (simple 3d)