MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Geometria Computacional e Diferencial:
As Curvas da Bosta
Ole Peter Smith,
ole@ufg.br, http://olepeter.mat.ufg.brInstituto de Matemática e Estatística, Universidade Federal de Goiás
FLISOL, Goiânia-GO
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Introduction
•
Playing with curves....
•
PHP (should become Python...)
•Graphical Library: GD - Open Source!
•Math... the truely divine!
Image
•Resolução: (R
x,
R
y).
•Drawing Area: (x
0,y
0), (x1,y
1). •Coordinates ↔ Pixels
xp
y
p=
ax
0
0
a
yx
y
+
bx
b
y⇔
ax
ay
=
−
Rx x1−x0 Ry y1−y0!
∧
bx
by
=
Rx
− ax
· x0
−ay
· y
0MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Image, Init Graphics
function Image_Init_Graphics() { $this->Image=imagecreate($this->R[0],$this->R[1]); } function Image_Save($fname,$n,$destroy=TRUE) { imagepng($this->Image,$fname.".".$n.".png"); if ($destroy) { imagedestroy($this->Img); } }
O Conhecimento se aprende com os Livros e os Mestres A Sabedoria se aprende com os humildes Cora Coralina-GO
Image, Init Canvas
function Image_Init_Canvas() { $this->Image_InitGraphics $this->A=array ( -1.0*$this->R[0]/($this->r1[0]-$this->r0[0]), 1.0*this->R[0]/($this->r1[1]-$this->r0[1]) ); $this->b=array ( 1.0*$this->R[0]-$this->A[0]*$this->r0[0] -$this->A[1]*$this->r0[1] ); }MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Image, Point2Pixels
function Point2Pixels($p) { return array ( $this->A[0]*p[0]+$this->b[0], $this->A[1]*p[1]+$this->b[1], ); } function Points2Pixels($ps) { foreach ($ps as $id => $p) { $ps[ $id ]=$this->Point2Pixel($p); } }I’m a Curve because I... Curve
Equation:
F (x , y ) = 0,
(x , y ) ∈ Ω
Parametrization:
r(t) =
x(t)
y (t)
,
t ∈ I
•Derivatives:
• 1st order Derivative • Tangent, Unit Tangent • Unit Normal• Fórmula de Taylor • 2nd order Derivative • Curvature
•
Integrals:
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Parabola
•Equation:
y = ax
2+
bx + c
•Parametrization:
x(t)
y (t)
=
t
at
2+
bt + c
,
t ∈ R
•Implementation:
function Parabola($t) { return array ( $t,$this->a*$t*$t + $this->b*t + $this->c, );
Ellipse
•Equation:
x
2a
2+
y
2b
2=
1
•Parametrization:
x(t)
y (t)
=
a cos t
b sin t
,
t ∈ R([0, 2π[)
•Implementation:
function Ellipse($t) { return array ( $this->$a*cos($t), $this->$b*sin($t), ); }MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Hyperbola
•Equation:
x
2a
2−
y
2b
2=
1
•Parametrization:
x(t)
y (t)
=
a cosh t
b sinh t
,
t ∈ R
•Implementation:
function Hyperbola($t) { return array ( $this->$a*cosh($t), $this->$b*sinh($t), ); }Divide Interval
function Get_ts($N,$t1,$t2) {
$dt=($t2-$t1)/(1.0*($N-1)); $ts=array();
for ($i=0,$t=$t1 ; $i<=$N ; $t+=$dt,$i++) {
array_push($rs,$t); }
return $ts; }
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Gather Curve Points
•
$R: ’Lambda’ function.
•Good old eval...
•
As unsave as your Programming Language and
Environment...
function CurvePoints($R,$N,$t1,$t2) { foreach ($this->Get_ts($N,$t1,$t2) as $t) { array_push($ps,$this->$R($t)); } return $ps; }Curve Animation
function CurveAnimate($R,$N,$t1,$t2) { $n=0; foreach ($this->Get_ts($N,$t1,$t2) as $t) { $this->Image_Init(); $ps=$this->CurvePoints($R,$n,$t1,$t); $this->DrawPoints($ps); $this->Image_Destroy($R,$n++); } system ("usr/bin/convert -loop 0 -delay 5 ". $R."*.png ".$R.".gif"
); }
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Cycloids
•
Circle Rolling on a Line
r(t) =
x(t)
y (t)
=
r (t − sin t
r (1 − cos t
,
t > 0
• function Cicloid($t) { return array ( $this->r*($t-sin($t)), $this->r*(1.0-cos($t)) ); }O bem que a violência faz é passageiro. O mal que ela faz é permanente. Mahatma
Cycloid
Figure:Animations/Cycloid.gif
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Cycloid
Figure: Animations/Cycloid_Poop.gif
Dia que bosta vale ouro Os pobres todos nascerão sem... Grafiti
Physics....
•Velocity:
r
0(t) =
v(t) =
x
0(t)
y
0(t)
•Acceleration:
r
00(t) =
a(t) =
x
00(t)
y
00(t)
•Taylor’s Formula:
r(t) = r(t
0) +
r
0(t
0)(t − t
0) +
1
2
r
00(t
0)(t − t
0)
2+
o
(t − t
0)
2 •Newton II:
m
r
00(t) =
F
extMADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Derivatives, Cycloid
Figure:Animations/Cycloid_Derivatives.gif
Deus não preocupa-se com as nossas dificuldades matemáticas... Ele integra empiricalmente. Einstein
Derivatives
function Df($func,$t,$eps) { return ($this->$func($t+$eps)-$this->$func($t-$eps)) / (2.0*$eps); } function D2f($func,$t,$eps) { return ( $this->Df($func,$t+$eps)-$this->Df($func,$t-$eps) ) / (2.0*$eps); }MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Accompanying Coordinate System
•
Unit Tangent:
t(t) =
r
0(t)
|r
0(t)|
•Transverse:
a =
a
xa
yb
a =
−a
ya
x •Unit Normal:
n(t) = bt(t)
•Sistema ortonormal: (
r(t), t(t), n(t)).
ACS, Cycloid
Figure:Animations/Cycloid_ACS.gif
Vive como se fosse morrer amanhã. Estude como se fosse viver para sempre. Einstein
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Curvature
•
Lines doesn’t curve...
•
Circles curves constantly: κ = 1/R.
•Regular Curve:
r
0(t) 6=
0.
•Curvature:
κ(t) =
x
0y
00− x
00y
0x
02+
y
023/2
• Ratio: ρ(t) = 1/κ(t) • Curvature Vector: c(t) = ρ(t)c(t) • Center of Curvature: rc(t) =r(t) + c(t) • Oscillating Circle: (x − xx)2+ (y − yc)2= ρ2 • Evolute: [ t∈I rc(t)Oscillating Circle
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Oscillating Circle, Curvature Vector
Figure: Animations/Circle_Oscillating.gif
Cycloid & Evolute
Figure:Animations/Cycloid_Evolute.gif
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Trochoids
•
Rolling circle ratio, a > 0.
•Poop ratio, b > 0.
•r(t) =
x(t)
y (t)
=
at − (a + b) sin t
a − (a + b) cos t
• function Trochoid($t) { return array ( $this->a*$t-($this->a+$this->b)*sin($t)), $this->a -($this->a+$this->b)*cos($t)) ); }Trochoids
Figure: Animations/Trochoid.gif
A seriedade dos acontecimentos da minha epoca, me enche de esperanças... Marx
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Trochoids
Figure:Animations/Trochoids.gif
Divide um maçã, que cada um fica com metade. Divide uma idéia... Compartilhe seus conhecimentos!
Epicycloid
•
Fixed Circle, radius R;
•
Circle, radius r , rolling outside;
•ρ =
R + r e ω =
R+rr=
ρr •r(t) =
x(t)
y (t)
=
ρ cos t − r cos ωt
ρ
sin t − r sin ωt
• function Epicicloid($t) { return array ( $this->rho*cos($t)-$this->r*cos($this->omega*$t), $this->rho*sin($t)-$this->r*sin($this->omega*$t) ); }MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Cardioid:
R = r .
Figure: Animations/Cardioid.gif
É melhor que o povo não saiba, como se fazem leis e salsichas Otto von Bismarck
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Epitrochoid
Poop size b > 0.
•ρ =
R + r ;
•σ =
R + r + b;
r(t) =
x(t)
y (t)
=
ρ cos t − σ cos ωt
ρ
sin t − σ sin ωt
= ρ
e(t) − σe(ωt)
•Angular Velocity: ω =
ρr;
• function Epicicloid($t) { return array ( $this->rho*cos($t)-$this->sigma*cos($this->omega*$t), $this->rho*sin($t)-$this->sigma*sin($this->omega*$t) ); }Figure: Animations/Epitrochoid.gif, R = 5r , r = 5b.
Quem leva braincadeira somente por brincadeira. E sério somente serio. De fato, desentendeu ambos. Piet Hein
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Epitrochoids
Hypocycloid
•
Circle, radius r , rolling inside a circle, radius R;
•ω =
R−rr •r(t) =
x(t)
y (t)
=
(R + r ) cos t + r cos ωt
(R + r ) sin t + r sin ωt
• function Hypocicloid($t) { return array ( $this->rho*cos($t)+ $this->r*cos($this->omega*$t), $this->rho*sin($t)+ $this->r*sin($this->omega*$t) ); }MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Hypotrochoid
•Poop size b > 0
•r(t) =
x(t)
y (t)
=
(R + r ) cos t + (b + r ) cos ωt
(R + r ) sin t + (b + r ) sin ωt
• function Hypotrochoid($t) { return array ( $this->rho*cos($t)+ ($this->r+$this->b)*cos($this->omega*$t), $this->rho*sin($t)+ ($this->r+$this->b)*sin($this->omega*$t) ); }MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Circle, radius
R, Rolling on a Curve,
r(t)
•Arc Length, s(t):
s(t) − s(t
0) =
Z
t t0|r
0(t)| dt
•Rolling Circle Center:
R
c(t) =
r(t) + Rn(t)
•
Rolling point angle:
θ =
s(t) − s(t
0)
R
•Unit Vector:
e(θ) =
cos θ
sin θ
•Rolling Point:
R(t) = r(t) + Rn(t) + Re(θ)
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Circle Rolling on a Parabola
Rolling on
y = sin(x )
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Rolling on
y = x (x − 1)(x − 2)
Rolling outside a Hiperbola
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR
Rolling inside a Hiperbola
Lisajous
MADE INLATEX. OLEPETERSMITH, IME/UFG -OLE@UFG.BR