考慮以下由 4 個點A
、B
、C
和構造的對稱(關於垂直軸)貝塞爾曲線D
。現在我想L
為其左側或右側部分構造另一個貝塞爾曲線(名為 )。
\documentclass[pstricks,border=24pt]{standalone}
\usepackage{pst-eucl}
\begin{document}
\begin{pspicture}[showgrid=false](-3,-1)(3,3)
\pstGeonode
(3,3){A}
(1,1){B}
(-1,1){C}
(-3,3){D}
\psbezier(A)(B)(C)(D)
\psline[linecolor=red](0,3)(0,-1)
\end{pspicture}
\end{document}
如果不先解多項式方程,如何建構貝塞爾曲線L
?歡迎使用 PSTricks(首選)或 TikZ 或 Asymptote 提供答案。
請注意,我討厭試誤法!
答案1
這是Asymptote
版本,它不使用通用Asymptote
命令來分割路徑(指南),它只是執行立方Bezier
線段的簡單細分:
// split.asy:
size(5cm);
pair A,B,C,D;
A=(3,3); B=(1,1); C=(-1,1); D=(-3,3);
pair P,B1,C1,B2,C2;
P=(A+D+3(B+C))/8;
B1 = (A+B)/2;
C1 = ((A+C)/2+B)/2;
C2 = (D+C)/2;
B2 = ((D+B)/2+C)/2;
guide g=A..controls B and C..D;
guide gl=A..controls B1 and C1..P;
guide gr=P..controls B2 and C2..D;
draw(g);
draw(gl,deepgreen+1.6bp+opacity(0.5));
draw(gr,red+1.6bp+opacity(0.5));
draw((0,3)--(0,-1),red);
dot(A--B--C--D--P,UnFill);
dot(B1--C1,deepgreen,UnFill);
dot(B2--C2,red,UnFill);
label("$A$",A,SE);
label("$B$",B,S);
label("$C$",C,S);
label("$D$",D,SW);
label("$P$",P,NE);
label("$B_1$",B1,E,deepgreen);
label("$C_1$",C1,E,deepgreen);
label("$B_2$",B2,W,red);
label("$C_2$",C2,W,red);
要獲得獨立版本split.pdf
,請運行asy -f pdf split.asy
.
答案2
@g.kov 在 PSTricks 中的 Asymptote 答案的翻譯版本。
\documentclass[pstricks,border=24pt]{standalone}
\usepackage{pst-eucl}
\begin{document}
\begin{pspicture}[showgrid=true](-3,-1)(3,3)
\pstGeonode
(3,3){A}
(1,1){B}
(-1,1){C}
(-3,3){D}
\psbezier(A)(B)(C)(D)
\psline[linecolor=red](0,3)(0,-1)
\nodexn{.125(A)+.125(D)+.375(B)+.375(C)}{R'}
\nodexn{.5(A)+.5(B)}{P'}
\nodexn{.25(A)+.5(B)+.25(C)}{Q'}
\pstGeonode
(P'){P}
(Q'){Q}
(R'){R}
\psbezier[linecolor=red](A)(P)(Q)(R)
\end{pspicture}
\end{document}