Initiate Ivan has just been hired as an intern. He is tasked with solving a seemingly simple problem.
Given the two points that define a line and the centre and and radius of a circle, Ivan is to determine whether the line intersects the circle. After hours of thinking, he came up with an approach. Taking one of the two points of the line as the origin, he plans to first find the angle formed by the line with the x-axis. Then he finds the angle formed by the line joining the centre of the circle and the "origin" earlier. He reasons that if the two angles are reasonably close, he can conclude that the line does intersect the circle.
Ivan's mentor comes around, looks at his solution, and smiles. "That's pretty interesting! But it seems to need more work..."
What is lacking in Ivan's solution?
Labels
algorithm
allegro
anime
api
arcade
asdf
blender
books
boost
bootstrap
c
c++
CLR
cmake
cmd
common lisp
concepts
css
detective
emacs
free
games
graphical programming
graphics
gui
haskell
html
hyper-v
interpersonal skills
jade
jam
java
javascript
jni
jpostal
leadership
libpostal
library
linux
lsp
lsp-mode
management
maths
mingw
msvc
msys2
music
network
oop
open source
party games
phaser
postgresql
programming
promote
puzzle
quickfix
recommended
recorder
reference
review
sdl2
self-help
setup
sheet music
slime
team building
tidbits
tools
travel
tutorial
typescript
unity
vb
vm
web pages
winapi
windows
windows 7
windows 8.1
Sunday, 23 February 2014
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment