A
4개의 점 , 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
일반 명령(가이드)을 사용하지 않고 3차 세그먼트의 간단한 분할을 수행하는 버전 입니다 .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
PSTricks에 있는 @g.kov의 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}