本文主要是介绍KaTex 编写示例 公式 数学公式,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
例1. 展示风格
编码:
$$
c(t) = \displaystyle\sum_{i=0}^nb**\scriptscriptstyle** i \displaystyle B \scriptscriptstyle i \displaystyle(t),0 \le t \le1, \tag{1}
$$
效果:
c ( t ) = ∑ i = 0 n b i B i ( t ) , 0 ≤ t ≤ 1 , (1) c(t) = \displaystyle\sum_{i=0}^nb\scriptscriptstyle i \displaystyle B\scriptscriptstyle i \displaystyle(t),0 \le t \le1, \tag{1} c(t)=i=0∑nbiBi(t),0≤t≤1,(1)
例2. 穿插风格
编码:
式中,n为次数,$b \scriptscriptstyle i$为第$i$个控制点,$B \scriptscriptstyle i,n \displaystyle (t)$为Bernstein基多项式,如式(2)所示:
效果:
式中,n为次数, b i b\scriptscriptstyle i bi为第 i i i个控制点, B i , n ( t ) B\scriptscriptstyle i,n \displaystyle (t) Bi,n(t)为Bernstein基多项式,如式(2)所示:
例3. 混合
编码:
$$
B \scriptscriptstyle i,n \displaystyle (t)=\dbinom{n}{i} ti(1-t){n-i},i = 0,…,n, \tag{2}
$$
式中,$\binom{n}{i}$是二项式系数
效果:
B i , n ( t ) = ( n i ) t i ( 1 − t ) n − i , i = 0 , . . . , n , (2) B\scriptscriptstyle i,n \displaystyle (t)=\dbinom{n}{i} t^i(1-t)^{n-i},i = 0,...,n, \tag{2} Bi,n(t)=(in)ti(1−t)n−i,i=0,...,n,(2)
式中, ( n i ) \binom{n}{i} (in)是二项式系数
例4. 矩阵
编码:
$$
\left[
\begin{matrix}
B_{0,3}(t_0) & \cdots & B_{3,3}(t_0) \\
B_{0,3}(t_1) & \cdots & B_{3,3}(t_1) \\
\vdots & \ddots & \vdots \\
B_{0,3}(t_m) & \cdots & B_{3,3}(t_m)
\end{matrix}
\right]
\left[
\begin{matrix}
b_{x0} & b_{y0} \\
b_{x1} & b_{y1} \\
b_{x2} & b_{y2} \\
b_{x3} & b_{y3}
\end{matrix}
\right] =
\left[
\begin{matrix}
p_{x0} & p_{y0} \\
p_{x1} & p_{y1} \\
\vdots & \vdots \\
p_{xm} & p_{ym}
\end{matrix}
\right]
\tag{4}
$$
效果:
[ B 0 , 3 ( t 0 ) ⋯ B 3 , 3 ( t 0 ) B 0 , 3 ( t 1 ) ⋯ B 3 , 3 ( t 1 ) ⋮ ⋱ ⋮ B 0 , 3 ( t m ) ⋯ B 3 , 3 ( t m ) ] [ b x 0 b y 0 b x 1 b y 1 b x 2 b y 2 b x 3 b y 3 ] = [ p x 0 p y 0 p x 1 p y 1 ⋮ ⋮ p x m p y m ] (4) \left[ \begin{matrix} B_{0,3}(t_0) & \cdots & B_{3,3}(t_0) \\ B_{0,3}(t_1) & \cdots & B_{3,3}(t_1) \\ \vdots & \ddots & \vdots \\ B_{0,3}(t_m) & \cdots & B_{3,3}(t_m) \end{matrix} \right] \left[ \begin{matrix} b_{x0} & b_{y0} \\ b_{x1} & b_{y1} \\ b_{x2} & b_{y2} \\ b_{x3} & b_{y3} \end{matrix} \right] = \left[ \begin{matrix} p_{x0} & p_{y0} \\ p_{x1} & p_{y1} \\ \vdots & \vdots \\ p_{xm} & p_{ym} \end{matrix} \right] \tag{4} ⎣⎢⎢⎢⎡B0,3(t0)B0,3(t1)⋮B0,3(tm)⋯⋯⋱⋯B3,3(t0)B3,3(t1)⋮B3,3(tm)⎦⎥⎥⎥⎤⎣⎢⎢⎡bx0bx1bx2bx3by0by1by2by3⎦⎥⎥⎤=⎣⎢⎢⎢⎡px0px1⋮pxmpy0py1⋮pym⎦⎥⎥⎥⎤(4)
例5. 其他
编码:
$$
op = bp \cdot \dfrac {g_{iw}} {h_{out}}+tp \cdot
(1-\dfrac {g_{ih}}{h_{out}})
$$
效果:
o p = b p ⋅ g i w h o u t + t p ⋅ ( 1 − g i h h o u t ) op = bp \cdot \dfrac {g_{iw}} {h_{out}}+tp \cdot (1-\dfrac {g_{ih}}{h_{out}}) op=bp⋅houtgiw+tp⋅(1−houtgih)
参考文档
欢迎访问我的博客
隆力奇的博客
这篇关于KaTex 编写示例 公式 数学公式的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!