Wednesday, May 15, 2024
HomeMatlabR2-D2, Rotations and Dilations in Two Dimensions » Cleve’s Nook: Cleve Moler...

R2-D2, Rotations and Dilations in Two Dimensions » Cleve’s Nook: Cleve Moler on Arithmetic and Computing


R2_D2 is is the title I’ve given a brand new MATLAB program that gives animations of 2-by-2 rotation and dilation matrices. I admit I selected “dilations” so the acronym can be memorable, however in any other case the code has little to do with the well-known Star Wars droid.

Contents

Home

This define of a home is featured in Experiments with MATLAB. The info are the 11 blue dots. The coordinates of every dot type a 2-by-1 vector; the 2-by-2 rotation and dilation matrices multiply every of those vectors individually. (The strains between the dots full the image and should not concerned in any computation.)

The home additionally seems in a number of editions of Gil Strang’s textbooks. The duvet of the third version of Strang’s Introduction to Linear Algebra options 9 homes on a quilt made by Gil’s good friend Chris Curtis.

Hand

This define of a hand, which I constructed from measurements of my very own hand, can be utilized in Experiments with MATLAB. There are 37 factors, so Hand is a 2-by-37 matrix.

Rotation

Multiplication by this matrix produces a two-dimensional rotation by an angle theta.

$$ R = left(
start{array}{rr}
cos{theta} & sin{theta}
– sin{theta} & cos{theta}
finish{array}
proper) $$

R is displayed within the first panel. If the home just isn’t rotating in your browser, do this hyperlink: https://blogs.mathworks.com/cleve/recordsdata/house_rotate.gif

Dilation

Dilation is the method of constructing objects bigger or smaller. Multiplication by this diagonal matrix produces a dilation by an element sigma.

$$ S = left(
start{array}{rr}
sigma & 0
0 & sigma
finish{array}
proper) $$

S is displayed within the second panel. The animation can be obtainable at: https://blogs.mathworks.com/cleve/recordsdata/hand_dilate.gif

Each

Right here rotation and dilation are mixed. The product of the rotation and dilation matrices drives the motion. If you’re lacking all of the motion, strive: https://blogs.mathworks.com/cleve/recordsdata/hand_both.gif

R2_D2

While you run R2_D2 by yourself laptop, you may drive the rotations and dilations your self. Mousing exterior of the article creates rotation and mousing inside produces dilation.

The R2_D2 program is offered from https://blogs.mathworks.com/cleve/recordsdata/R2__D2.m.

Additional Studying

If you’re not aware of matrices, or simply need a fast refresher, try the Matrices chapter of Experiments with MATLAB. Train 4.14 is especially useful.

Printed with MATLAB® R2023a

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments