Using animations within L A T EX documents Michael Doob Department - - PowerPoint PPT Presentation

using animations within l a t ex documents
SMART_READER_LITE
LIVE PREVIEW

Using animations within L A T EX documents Michael Doob Department - - PowerPoint PPT Presentation

Using animations within L A T EX documents T EX Users Group meetingJuly 30, 2014 Michael Doob Using animations within L A T EX documents Michael Doob Department of Mathematics University of Manitoba July 30, 2014 Using animations


slide-1
SLIDE 1

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Using animations within L

AT

EX documents

Michael Doob

Department of Mathematics University of Manitoba

July 30, 2014

slide-2
SLIDE 2

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Static graphics

F E A =

  • cos(α), sin(α)
  • B =
  • cos(α + β), sin(α + β)
  • (1, 0)

D = (d, 0) α β

π 2 − α

α

Graphic by Asymptote

And hence

◮ sin(α + β) = sin(α) cos(β) + cos(α) sin(β) ◮ cos(α + β) = cos(α) cos(β) − sin(α) sin(β)

slide-3
SLIDE 3

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Extreme cases

slide-4
SLIDE 4

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

How it’s done

  • 1. Generate each frame
  • 2. Stitch frames together and include in pdf file
  • 3. Stitch frames together for other formats (animated gifs)
slide-5
SLIDE 5

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

The falling ladder problem

A ladder leans against a wall. The bottom of the ladder is pulled away from the wall causing top to drop down. What path does the midpoint of the ladder take?

Graphic by TikZ

◮ Concave up ◮ Straight line ◮ Concave down

slide-6
SLIDE 6

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Solution to the falling ladder problem

(0, 0)

ℓ 2

Graphic by TikZ

ℓ = length of the ladder

slide-7
SLIDE 7

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Animations of falling ladders

Graphics by PostScript

slide-8
SLIDE 8

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

How it’s done

  • 1. Master PostScript file with a parameter
  • 2. Generate individual PS files (sed in this case)
  • 3. Convert each PS file to png format (ImageMagick in this case)
  • 4. Use \animategraphics (from animate package with pdfL

AT

EX)

\animategraphics[loop,width=4.5cm]{16}{ladder}{239}{200}

  • 5. Convert each PS file to gif format (ImageMagick)
  • 6. Create animated gif from these files (ImageMagick)
slide-9
SLIDE 9

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Envelope of lines joining (0, t) to ( √ 1 − t2, 0) for 0 ≤ t ≤ 1

Graphics by Sage

slide-10
SLIDE 10

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

How it’s done

  • 1. Sage generates single file of pdf graphics pages with one command
  • 2. \animategraphcs stitches pages into an animation

\animategraphics[width=5.5cm]{12}{envelope}{}{}

slide-11
SLIDE 11

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Slicing the cube

A cube is sliced perpediculary at the midpoint of the axis joining antipodal

  • points. What is the cross-section?
slide-12
SLIDE 12

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Slicing the cube solution

Graphic by Asymptote and ImageMagick

slide-13
SLIDE 13

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

How it’s done

  • 1. Create asymptote file for 3d image with up/down parameter
  • 2. Generate eps file
  • 3. Convert to png
  • 4. Use \multiframe with animateinline from the animate package

\multiframe{32}{iFnum=100+1}{\includegraphics{cube\iFnum.png}}

slide-14
SLIDE 14

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Graphic by Sage-gererated frames

      1 3 4 2 3 4 5 4 1 2 3 2 1 2 4 1 1 3      

slide-15
SLIDE 15

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

How it’s done

  • 1. Use sage to generate the L

AT

EX code for individual frames

  • 2. Use \include to insert it in the proper place
  • 3. Run with \animateinline environment

\begin{frame} . . . \end{frame}

slide-16
SLIDE 16

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Graphic by Asymptote and animategraphics

slide-17
SLIDE 17

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

How it’s done

  • 1. Use asymptote to make pdf of partial path
  • 2. Use \shipout in asymptote to make pdf frames
  • 3. Run with \animategraphics
slide-18
SLIDE 18

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Graphic by Asymptote and animategraphics

slide-19
SLIDE 19

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Graphic by Asymptote and animategraphics

slide-20
SLIDE 20

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

How it’s done

  • 1. Use loop within asymptote to make a pdf file of one frame per page
  • 2. Run with \animategraphics

\animategraphics[loop,height=5cm]{16}{circle-rot}{0}{99}

slide-21
SLIDE 21

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Rotations in the plane

θ x y x y = L(x)

y = cos(θ) − sin(θ) sin(θ) cos(θ)

  • x
slide-22
SLIDE 22

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

Apply cos(θ) − sin(θ) sin(θ) cos(θ) k to each point:

Graphic by TikZ images and animateinline

slide-23
SLIDE 23

Using animations within L

AT

EX documents

Michael Doob

T EX Users Group meeting—July 30, 2014

How it’s done

  • 1. L

AT

EX def with one parameter to make one TikZ figure

  • 2. while/do loop within animateinline