NCTM 2008 Reno NV Algorithmic Geometry Pierre Bierre
NCTM 2008 Reno NV Algorithmic Geometry Pierre Bierre Algo. Geom. org Pleasanton CA copyright Spatial Thoughtware 2008 Algo Geom / NCTM 08 Reno
What is Algorithmic Geometry? ? MATHEMATICS paper & pencil sketching vector features new formal concepts COMPUTER SCIENCE Java programming interactive graphics automate your math know-how Advanced geometry problem-solving SCIENCE ENGINEERING Algo Geom / NCTM 08 Reno
Pierre BS Theoretical Physics MS Computer Science motion picture artificial intelligence Neuropsychology immunology data analysis 2003: algorithmic geometry crystallized robotics 2004 book: Flexing the Power of Algorithmic Geometry 2005: pilot course (proof-of-concept) Algo Geom / NCTM 08 Reno
Today’s outline 2 D Getting started with Java 2 D graphics Core 2 D representations Lab problem exercises Group exercise: problem from week 6 3 D Core 3 D representations 3 D graphics workspace Results from 2005 pilot How can I get involved? Algo Geom / NCTM 08 Reno
Getting started with Java… Algo Geom / NCTM 08 Reno
Core 2 D mathematical representations Algo Geom / NCTM 08 Reno
How to represent 2 D direction? In the computer, q is just a number y [1 1] unit circle . 78539 7. 06858 -5. 49778 … p/4 q x not a 1: 1 representation! 0 <= q < 2 p [ -1 -1 ] 0. 000001 6. 283184 discontinuity at 2 p ! A single real number doesn’t have the information capacity to do the job Algo Geom / NCTM 08 Reno
How to represent 2 D direction? y [1 1] unit circle [. 707 ] d 1 q d 2 x [. 894 -. 447 ] [ -1 -1 ] Algo Geom / NCTM 08 Reno
How to represent 2 D direction? y [1 1] unit circle d 1 [. 707 ] [. 708, . 706 ] direction vector x d 2 [. 894 -. 447 ] unit vector used to represent spatial direction [ -1 -1 ] Advantages (computational and mental): 1: 1 representation continuity extends naturally to 3 D Algo Geom / NCTM 08 Reno
How do you compute direction vectors? y from points! [1 1] d 1 2 x d 2 unit circle [1 1] d 1 = [ 1 1 ]norm = = len ([ 1 1 ]) [ 2 -1 ] = d 2 = [ 2 -1 ]norm = len ([ 2 -1 ]) [ 2 -1 ] [1 1] sqrt ( 12 + 12 ) [ 2 -1 ] sqrt ( 22 + -12 ) = = [1 1] 1. 414 [ 2 -1 ] 2. 236 = [. 707 ] = [. 894 -. 447 ] Algo Geom / NCTM 08 Reno
You can compute direction from p 1 to p 2… y p 2 x d p 1 d = normalize (p 2 – p 1) Algo Geom / NCTM 08 Reno
Line “hit-testing” problem…. Algo Geom / NCTM 08 Reno
How to represent infinite 2 D lines? What is invariant (numerically) about all points on line L? L y y = mx + b (m = dy/dx) o x l fails for vertical lines! algos must handle all cases p • o == l o = orientation (direction perpendicular to line) l = signed distance from origin [ o l ] representation of 2 D line Algo Geom / NCTM 08 Reno
How to do coordinate rotation? (without angles) Algo Geom / NCTM 08 Reno
Coordinate rotation… y new. Yaxis p 1 x new. Xaxis What are new coordinates of p 1 if axes are rotated as shown? Instead of angle q, just say the new. Xaxis direction you want to use Algo Geom / NCTM 08 Reno
Learn how to visualize dot product of two vectors y p 3 p 1 x d p 2 d • p gives new coordinate of p along new axis d dot. Prod (d, p) = d. x * p. x + d. y * p. y Algo Geom / NCTM 08 Reno
p • new. Xaxis --> new x coord… p • new. Yaxis --> new y coord… y p 3 new. Yaxis p 1 x new. Xaxis p 2 Write a general purpose Rotate (point) function: p’ = [ p • new. Xaxis p • new. Yaxis ] Algo Geom / NCTM 08 Reno
New point values after rotation… y/ p 3/ p 1/ x/ p 2/ p 1_prime = rotate ( new. Xaxis, p 1 ); p 1 = unrotate ( new. Xaxis, p 1_prime ); Algo Geom / NCTM 08 Reno
Editable tilted rectangle problem… Algo Geom / NCTM 08 Reno
2 D object intersection problems: L CIR L 2 L 1 i i 2 i 1 C 2 i 2 C 1 Algo Geom / NCTM 08 Reno
Problem-solving methodology Problem statement Sketch out a mental solution 0: dist (c 1, c 2) > r 1 + r 2 Write pseudocode if (Vec 2. distance(C 1. c, C 2. c) Translate algo into Java Test algo graphically Algo Geom / NCTM 08 Reno
Solve: Intersection of 2 circles i 1 C 2 i 2 C 1 Given: C 1 = [ c 1 r 1 ] C 2 = [ c 2 r 2 ] (any possible) Solve for: num. Intersection. Pts (0, 1, 2, 3 =∞) i 1 i 2 Algo Geom / NCTM 08 Reno
Subproblem: How many intersection points? # num. Int. Pts ∞ Draw examples Decision logic identical (C 1, C 2) dist(c 1 , c 2) == r 1 + r 2 dist(c 1 , c 2) == abs(r 1 - r 2) dist(c 1 , c 2) > r 1 + r 2 dist(c 1 , c 2) < abs(r 1 - r 2) none of the above Algo Geom / NCTM 08 Reno
y Subproblem: Locations of intersection points? C 2 x C 1 i 1 new. Origin C 2 ’ y’ i 2 C 1 ’ translate coords i 1 ’ new. Xaxis i 2 ’ x’ C 1’’ (C 1. c, C 2) C 2’ = translate (new. Origin, y’’ i 1’’ C 2’’ x’’ rotate coords i 2’’ C 22’’’’ == rotate (C (new. Xaxis, C ’)2’) 2’. cnorm, C 2 C Algo Geom / NCTM 08 Reno
a 2 + h 2 = r 1 2 y’’ b 2 + h 2 = r 2 2 C 1’’ C 2’’ i 1’’ r 1 a h c a 2 - b 2 = r 1 2 - r 2 2 r 2 b i 2’’ c= a+b x’’ (a + b) (a - b) = r 12 - r 22 c (a - b) = r 12 - r 22 a - b = (r 12 - r 22) / c a+b=c 2 a = c + (r 12 - r 22) / c 2 a = c 2/c + (r 12 - r 22) / c c = C 2’’. c. x a = (c 2 + r 12 - r 22) / 2 c h = sqrt(r 12 - a 2) i 1’’ = [ a h ] i 2’’ = [ a -h ] Algo Geom / NCTM 08 Reno
y Subproblem: Locations of intersection points? C 1 i 1 = untranslate (C 1. c, i 1’) i 2 = untranslate (C 1. c, i 2’) C 2 x i 1 new. Origin y’ i 2 C 1 ’ translate coords C 2 ’ i 1 ’ new. Xaxis i 2 ’ i 1’ = unrotate (C 2’. cnorm, i 1’’) i 2’ = unrotate (C 2’. cnorm, i 2’’) x’ C 1’’ C 2’ = translate (C 1. c, C 2) y’’ i 1’’ C 2’’ x’’ rotate coords i 2’’ C 2’’ = rotate (C 2’. cnorm, C 2’) Algo Geom / NCTM 08 Reno
Java coding… Algo Geom / NCTM 08 Reno
Exploring Problem Challenges…. . y wt 60 socket rotating caddy c x a Algo Geom / NCTM 08 Reno
Exploring Problem Challenges…. . “I’m crashed in the Nevada desert, and this will be my last call. I’ll give you the info you need to place my location on a curved search path… Mt. Ritter Mt. Whitney 36 19/128 30 30 Algo Geom / NCTM 08 Reno
3 D algo. Geom Algo Geom / NCTM 08 Reno
Develop formal representations for these 3 D objects: • 3 D direction vector zz • planes y [ 1 1 1] z new. Yaxis [-1 -2 2] y • coordinate rotations (rotators) • lines • spheres L [-. 33 z-. 66] d 1 PL PL 1 l SPH d 2 SPH 1 y new. Zaxis • circles i 2 / / [. 58. 58] y z L L SPH 2 x PL 2 x ii 1 o CIR x L / CIR y x / / [x y ] / new. Xaxis x unit sphere Object intersections: plane-plane-line 3 -plane sphere-sphere-circle 3 -sphere (GPS) Algo Geom / NCTM 08 Reno
3 D graphics workspace Algo Geom / NCTM 08 Reno
Results from 2005 pilot course student feedback: getting my computer to do all the gruntwork - way cool! Java programming picked up in 2 weeks elegant compared to traditional geometry / trig gave me advantage later in college math/engineering course “proof of concept”: syllabus fit into 72 -hours classtime (no homework) labs easy to grade learning results impressive - student programs sophisticated seek funding for feasibility Algo Geom / NCTM 08 Reno
Example of student work (from final exam) Algo Geom / NCTM 08 Reno
Summary of algorithmic geometry spatial problem-solving as human-computer partnership representations modernized for ease-of-algorithm-writing concepts scale up intuitively from 2 D 3 D learn Java programming by osmosis surge in problem-solving confidence fast-track for students considering STEM Algo Geom / NCTM 08 Reno
How can I get involved? (contingent on funding) Participate in Algorithmic Geometry summer workshop Pick a student TA w/ Java - we’ll train you as a team Team-teach a pilot course on your home turf Get paid as educational researchers Help leapfrog U. S. math education Contact Algo Geom Project: Pierre Bierre pierre@Algo. Geom. org 925 -200 -1558 Algo Geom / NCTM 08 Reno
Algo Geom / NCTM 08 Reno
- Slides: 37