library(animation)
## Warning: package 'animation' was built under R version 4.2.2
library(gifski)
## Warning: package 'gifski' was built under R version 4.2.2

My Initials are AM so here is the basis

x=c(seq(0,.25,length.out=1000), seq(0,.125,length.out=1000),seq(.125,.25,length.out=1000), seq(.375,.5,length.out=1000),seq(.5,.625,length.out=1000), seq(.625,.750,length.out=1000), seq(.750,.875,length.out=1000))
y=c(seq(0,0,length.out=1000),seq(-1,1,length.out=1000), seq(1,-1,length.out=1000), seq(-1,1,length.out=1000), seq(1,0,length.out=1000), seq(0,1,length.out=1000), seq(1,-1,length.out=1000))

z=rbind(x,y)

plot(y~x, xlim=c(-3,3), ylim=c(-3,3))

Shear

z=rbind(x,y)
for (i in seq(0,.5,length.out=5)) {
  ident <- diag(2)
  ident[1,2] <- i
  temp<- ident %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}
for (i in seq(.5,0,length.out=5)) {
  ident <- diag(2)
  ident[1,2] <- i
  temp<- ident %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}
for (i in seq(0,.5,length.out=5)) {
  ident <- diag(2)
  ident[1,2] <- -i
  temp<- ident %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}
for (i in seq(.5,0,length.out=5)) {
  ident <- diag(2)
  ident[1,2] <- -i
  temp<- ident %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}

Scale

z=rbind(x,y)


for (x_scale in seq(1,6,length.out=5)) {
  for (y_scale in seq(1,6,length.out=5)) {
    ident <- diag(2)
    ident[1,1] <- x_scale # Width 
    ident[2,2] <- y_scale #height
    temp<- ident %*% z
    plot(temp[2,]~temp[1,], xlim=c(-5,5), ylim=c(-5,5))
  }
}

Rotate

Thought I’d base my spec off my reading here: https://gautamnagrawal.medium.com/rotating-image-by-any-angle-shear-transformation-using-only-numpy-d28d16eb5076

z=rbind(x,y)
for (i in seq(0,2*pi,length.out=24)) {
  base <- matrix(c(cos(i),-sin(i),sin(i),cos(i)),nrow=2,ncol=2)
  temp<- base %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}

Project

Used this page from mathworks for how to construct the matrix: https://www.mathworks.com/help/phased/ref/rotz.html

z=rbind(x,y)
for (i in seq(0,2*pi,length.out=12)) {
  tempZ<-rbind(z,rep(0,ncol(z)))
  base <-matrix(c(1,0,0,0,cos(i),-sin(i),0,sin(i),cos(i)),nrow=3,ncol=3)
  temp<- base %*% tempZ
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}

And all Together

x=c(seq(0,.25,length.out=1000), seq(0,.125,length.out=1000),seq(.125,.25,length.out=1000), seq(.375,.5,length.out=1000),seq(.5,.625,length.out=1000), seq(.625,.750,length.out=1000), seq(.750,.875,length.out=1000))
y=c(seq(0,0,length.out=1000),seq(-1,1,length.out=1000), seq(1,-1,length.out=1000), seq(-1,1,length.out=1000), seq(1,0,length.out=1000), seq(0,1,length.out=1000), seq(1,-1,length.out=1000))

z=rbind(x,y)

plot(y~x, xlim=c(-3,3), ylim=c(-3,3))
ident <- diag(2)

for (i in seq(0,.5,length.out=5)) {
  ident <- diag(2)
  ident[1,2] <- i
  temp<- ident %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}
for (i in seq(.5,0,length.out=5)) {
  ident <- diag(2)
  ident[1,2] <- i
  temp<- ident %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}
for (i in seq(0,.5,length.out=5)) {
  ident <- diag(2)
  ident[1,2] <- -i
  temp<- ident %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}
for (i in seq(.5,0,length.out=5)) {
  ident <- diag(2)
  ident[1,2] <- -i
  temp<- ident %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}
ident <- diag(2)

for (x in seq(1,6,length.out=5)) {
  for (y in seq(1,6,length.out=5)) {
    ident <- diag(2)
    ident[1,1] <- x_scale # Width 
    ident[2,2] <- y_scale #height
    temp<- ident %*% z
    plot(temp[2,]~temp[1,], xlim=c(-5,5), ylim=c(-5,5))
  }
}
for (i in seq(0,2*pi,length.out=24)) {
  ident <- matrix(c(cos(i),-sin(i),sin(i),cos(i)),nrow=2,ncol=2)
  temp<- ident %*% z
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}
for (i in seq(0,2*pi,length.out=12)) {
  tempZ<-rbind(z,rep(0,ncol(z)))
  ident <-matrix(c(1,0,0,0,cos(i),-sin(i),0,sin(i),cos(i)),nrow=3,ncol=3)
  temp<- ident %*% tempZ
  plot(temp[2,]~temp[1,], xlim=c(-3,3), ylim=c(-3,3))
}