By xyz coordinate definition, note we are using \(t\), not arc length \(s\), as an input: \[\bar r=\{x=f(t),y=g(t),z=h(t)\}\] In our example, \(\bar r=\{t,t^2,2/3t^3\}\).
require(Deriv)
## Loading required package: Deriv
## Warning: package 'Deriv' was built under R version 4.0.5
#rbar
x="t"
y="t^2"
z="2/3*t^3"
rbar=c(x,y,z)
t=1
#x,y,z given t=1 are {1,1,2/3}
sapply(rbar,function(m) eval(parse(text=m)))
## t t^2 2/3*t^3
## 1.0000000 1.0000000 0.6666667
Tangent vector: \(\bar r'=\{1,2t,2t^2\}\). With \(t=1\), \(\{x=1, y=2t=2, z=2t^2=2\}\), then the tangent line is: \(x,y,z=\{1,2,2/3\}+t\{1,2,2\}\)
tangent_vector=sapply(rbar,function(m) Deriv(m,"t"))
#tangent vector given t=1 is {1,2,2}
sapply(tangent_vector,function(m) eval(parse(text=m)))
## t t^2 2/3*t^3
## 1 2 2
#tangent line
tangent_line="c(1,1,2/3)+t*c(1,2,2)"
Tangent vector length:\(||\bar r'||=\sqrt{1^2+(2t)^2+(2t^2)^2}=1+2t^2\) Unit tangent: \(T=\frac{\bar r'}{||\bar r'||}=\frac{\{1,2t,2t^2\}}{1+2t^2}\)
length_tangent=paste0("(",tangent_vector,")^2",collapse="+")
length_tangent=paste0("sqrt(",length_tangent,")")
#use (1+2*t^2)^2==1+4*t^2+(2*t^2)^2 continue simplify
length_tangent="(1+2*t^2)" #||r'||
unit_tangent=paste0(tangent_vector,"/",length_tangent)
#At t=1, unit tangent is {1/3,2/3,2/3}
sapply(unit_tangent,function(m) eval(parse(text=m)))
## 1/(1+2*t^2) 2 * t/(1+2*t^2) 2 * t^2/(1+2*t^2)
## 0.3333333 0.6666667 0.6666667
Principal normal or unit normal vector \(N\) is computed by derivative of the unit tangent vector divided by the length of derivative of the unit tangent vector. \[N=\frac{T'}{||T'||}\] Derivative of the unit tangent: \(T'=\frac{\{-4t,(2-4t^2),4t\}}{(1+2t^2)^2}\) Length of derivative of the unit tangent vector:\(||T'||=\frac{\sqrt{(-4t)^2+(2-4t^2)^2+(4t)^2}}{(1+2t^2)^2}\)
deriv_unit_tangent=sapply(unit_tangent,function(m) Deriv(m,"t"))
norm_deriv_unit_tangent=paste0("(",deriv_unit_tangent,")^2",collapse="+")
norm_deriv_unit_tangent=paste0("sqrt(",norm_deriv_unit_tangent,")")
principal_normal=paste0(deriv_unit_tangent,"/",norm_deriv_unit_tangent)
#principal normal vector at t=1, {-2/3,-1/3,2/3}
sapply(principal_normal,function(m) eval(parse(text=m)))
## -(4 * (t/(1 + 2 * t^2)^2))/sqrt((-(4 * (t/(1 + 2 * t^2)^2)))^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; (2 - 8 * (.e1/.e2))/.e2; })^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; t * (4 - 8 * (.e1/.e2))/.e2; })^2)
## -0.6666667
## {.e1 <- t^2; .e2 <- 1 + 2 * .e1; (2 - 8 * (.e1/.e2))/.e2; }/sqrt((-(4 * (t/(1 + 2 * t^2)^2)))^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; (2 - 8 * (.e1/.e2))/.e2; })^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; t * (4 - 8 * (.e1/.e2))/.e2; })^2)
## -0.3333333
## {.e1 <- t^2; .e2 <- 1 + 2 * .e1; t * (4 - 8 * (.e1/.e2))/.e2; }/sqrt((-(4 * (t/(1 + 2 * t^2)^2)))^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; (2 - 8 * (.e1/.e2))/.e2; })^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; t * (4 - 8 * (.e1/.e2))/.e2; })^2)
## 0.6666667
Principal normal vector is only a direction, we need to provide the correct length, \(||\bar r'||\), to make the principal normal line. https://metric.ma.ic.ac.uk/metric_public/vectors/vector_coordinate_geometry/vector_equation_of_line.html
At \(t=1\), the \(||\bar r'||=\sqrt{9}=3\), and \(N=\{-2/3,-1/3,2/3\}\). Therefore, \(||\bar r'||N=\{-2,-1,2\}\).
\[\{x,y,z\}=\{x_a,y_a,z_a\}+t||\bar r'||N\]
normal_line_vector=paste0("(",length_tangent,")*(",principal_normal,")")
#principal normal vector at t=1, {-2,-1,2}
sapply(normal_line_vector,function(m) eval(parse(text=m)))
## ((1+2*t^2))*(-(4 * (t/(1 + 2 * t^2)^2))/sqrt((-(4 * (t/(1 + 2 * t^2)^2)))^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; (2 - 8 * (.e1/.e2))/.e2; })^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; t * (4 - 8 * (.e1/.e2))/.e2; })^2))
## -2
## ((1+2*t^2))*({.e1 <- t^2; .e2 <- 1 + 2 * .e1; (2 - 8 * (.e1/.e2))/.e2; }/sqrt((-(4 * (t/(1 + 2 * t^2)^2)))^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; (2 - 8 * (.e1/.e2))/.e2; })^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; t * (4 - 8 * (.e1/.e2))/.e2; })^2))
## -1
## ((1+2*t^2))*({.e1 <- t^2; .e2 <- 1 + 2 * .e1; t * (4 - 8 * (.e1/.e2))/.e2; }/sqrt((-(4 * (t/(1 + 2 * t^2)^2)))^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; (2 - 8 * (.e1/.e2))/.e2; })^2+({.e1 <- t^2; .e2 <- 1 + 2 * .e1; t * (4 - 8 * (.e1/.e2))/.e2; })^2))
## 2
#principal normal line at t=1
principal_normal_line="c(1,1,2/3)+t*c(-2,-1,2)"
Binormal is a vector \(B\) such that unit tangent vector cross product principal normal vector. https://math.stackexchange.com/questions/1395970/what-is-the-logic-rationale-behind-the-vector-cross-product \[B=T \times N \] For example, \(b=\{b_1,b_2,b_3\}\) and \(c=\{c_1,c_2,c_3\}\), we can have \(b\times c= \{b_2c_3-b_3c_2,\ b_3c_1-b_1c_3,\ b_1c_2-b_2c_1\}\)
On a space curve, the three mutually perpendicular unit vectors \(T\), \(N\) and \(B\) is called a moving trihedral.
Normal plane contains the principal normal and the binormal.
Osculating plane contains the unit tangent vector and the principal normal.
Rectifying plane contains the unit tangent and the binormal.
Derivative of unit tangent is \(T'\), tangent is \(\bar r'\), ratio of their lengths is the space curve curvature. In our example \(t=1\), we get \(\kappa(t) = \frac{2}{(1+2t^2)^2}=2/9\). \[\kappa=\frac{||T'||}{||\bar r'||} \]
kappa=paste0("(",norm_deriv_unit_tangent,")/(",length_tangent,")")
eval(parse(text=kappa))
## [1] 0.2222222
Radius of curvature of a space curve is \(\rho=1/\kappa\).
Two vectors \(dB/dt\) and \(N\) have either same or opposite directions perpendicular to vectors \(T\) and \(B\). So we can have a multiple \(\tau\) to make two identical vectors \[\frac{dB}{dt}=-\tau N\] The \(\tau\) is called torsion for measuring twisting of a space curve. We can see it is a part of the Frenet-Serret formulas.
\[\frac{dT}{dt}=\kappa N\\\frac{dN}{dt}=\tau B-\kappa T\\\frac{dB}{dt}=-\tau N\]
We can have following results. \[T=\frac{\bar r'}{||\bar r'||}\\N=\frac{(\bar r'\times \bar r'') \times \bar r'}{||(\bar r'\times \bar r'') \times \bar r'||}\\B=\frac{\bar r'\times \bar r''}{||\bar r'\times \bar r''||}\\\kappa=\frac{||\bar r'\times \bar r''||}{||\bar r'||^3}\\\tau=\frac{(\bar r'\times \bar r''). \bar r'''}{||\bar r'\times \bar r''||^2}\]
Some space curves may have same curvature and torsion, except position and orientation of these curves are different. Therefore curvature and torsion are considered as the essential invariant properties of the curves, and denoted by functions: \[\kappa=\kappa(t)\\ \tau=\tau(t)\] Also known as the intrinsic equations to define curvature and torsion at each point.