ぱらぱらめくる『曲面と多様体』1. 曲線論

  • 1. 曲線論
    • パラメタ表示された曲線を描いてみよう
    • パラメタ表示して、そのパラメタについての速度が0になる点がないような曲線が「都合がよい」

# 曲線
t<-seq(from=-1,to=1,length=10000)
library(rgl)
# 例1.1 直線
df<-3
a<-runif(df)
b<-runif(df)
x<-t(t(outer(t,a,"*"))+b)
plot3d(x)

# 例1.2 螺旋
a<-runif(1)
b<-runif(1)
T<-50
thist<-t*T
x[,1]<-a*cos(thist)
x[,2]<-a*sin(thist)
x[,3]<-b*thist
plot3d(x)

# 例1.3 尖点
x<-matrix(0,length(t),2)
x[,1]<-t^2
x[,2]<-t^3
plot(x)

# 例1.9 
x<-matrix(0,length(t),3)
a<-runif(1)
b<-runif(1)
x[,1]<-t
x[,2]<-a*t^2
x[,3]<-b*t^3
plot3d(x)

# 例1.10 
x<-matrix(0,length(t),3)
x[,1]<-t
x[,2]<-t^3
x[,3]<-t^4
plot3d(x)

# 例1.11
x<-matrix(0,length(t),1)
x[,1]<-exp(-1/t)
x[which(t<=0),1]<-0
plot(t,x)

# 例1.12
theta<-runif(1)
tmpt<-t[which(t!=0)]
t1<-matrix(0,length(tmpt),1)
t1[,1]<-exp(-1/tmpt)
t1[which(tmpt<=0),1]<-0
t2<-matrix(0,length(tmpt),1)
t2[,1]<-exp(1/tmpt)
t2[which(tmpt>=0),1]<-0

x<-matrix(0,length(tmpt),3)
x[,1]<-t2+t1*cos(theta)
x[,2]<-t1*sin(theta)
x[,3]<-tmpt
plot3d(x)

# 例1.13
tmpt<-t[which(t!=0)]
t1<-matrix(0,length(tmpt),1)
t1[,1]<-exp(-1/tmpt)
t1[which(tmpt<=0),1]<-0

f<-rep(0,length(tmpt))
f[which(tmpt>0)]<-t1[which(tmpt>0)]*cos(10/tmpt[which(tmpt>0)])
g<-rep(0,length(tmpt))
g[which(tmpt>0)]<-t1[which(tmpt>0)]*sin(10/tmpt[which(tmpt>0)])

x[,1]<-f
x[,2]<-g
x[,3]<-tmpt
plot3d(x)