Das Zeichnen einer parametrischen Linie mit unitärem Direktorvektor erzeugt eine längere gerade Linie mit PGFPlots

Das Zeichnen einer parametrischen Linie mit unitärem Direktorvektor erzeugt eine längere gerade Linie mit PGFPlots

Ich möchte eine normale Begrenzungslinie zu einer Fläche in einem Punkt zeichnen.

Die Oberfläche ist y=xund der Punkt ist (1/2,1/2,1). Die Steigung ist (-1,1,0), und am Punkt (1/2,1/2,1)ist immer noch dieselbe, daher wäre die Normallinie (x-1/2)/(-1)=(y-1/2)/(1)=(z-1)/(0), daher wird die Linie durch beschrieben (.5,.5,1)+t(-1,1,0).

Ich möchte jedoch, dass die Zeilebegrenzt, um eineEinheitsdirektor-Vektor, aber ich kann das nicht machen. Ich verwende tzwischen 0und 1, aber diese zeichnen eine lange Linie; ich möchte, dass es ein Vektor von istLänge1.

Ich bin nicht sicher, ob diese Mathematik richtig ist. Wenn ich den Einheitsvektor davon finde, (-1,1,0)also (-1,1,0)/(sqrt(2))habe (-sqrt(2)/2,sqrt(2)/2,0)ich immer noch keinen Vektor der Länge1 (wenn tzwischen 0und liegt 1).

Hier ist mein MWE:

\documentclass{article}
\usepackage[a4paper,margin=1in,footskip=0.25in]{geometry}

\usepackage{pgfplots}
\pgfplotsset{compat=1.15}

\begin{document}

\begin{center}
    \begin{tikzpicture}
        \begin{axis} [
                title={Without normalizing $(-1,1,0)$ ($t\in[0,1]$)},
                axis on top,
                axis lines=center,
                xlabel=$x$,
                ylabel=$y$,
                zlabel=$z$,
                ticklabel style={font=\tiny},
                view={115}{25}
            ]
            \addplot3[opacity=.5,surf,samples=21,variable=\t,variable y=\s,domain=0:2,y domain=0:90,z buffer=sort,colormap={red}{color=(red) color=(red)}] ({\t*cos(\s)*(sqrt(2)*.5)},{\t*cos(\s)*(sqrt(2)*.5)},{\t*sin(\s)});%Red S
            \addplot3[-stealth,variable=\t,domain=0:1] ({1/2+t},{1/2-t},{1});
        \end{axis}
    \end{tikzpicture}
    \hfill
    \begin{tikzpicture}
        \begin{axis} [
                title={Normalizing $(-1,1,0)$ ($t\in[0,1]$)},
                axis on top,
                axis lines=center,
                xlabel=$x$,
                ylabel=$y$,
                zlabel=$z$,
                ticklabel style={font=\tiny},
                view={115}{25}
            ]
            \addplot3[opacity=.5,surf,samples=21,variable=\t,variable y=\s,domain=0:2,y domain=0:90,z buffer=sort,colormap={red}{color=(red) color=(red)}] ({\t*cos(\s)*(sqrt(2)*.5)},{\t*cos(\s)*(sqrt(2)*.5)},{\t*sin(\s)});%Red S
            \addplot3[-stealth,variable=\t,domain=0:1] ({1/2+(sqrt(2)/2)*t},{1/2-(sqrt(2)/2)*t},{1});
        \end{axis}
    \end{tikzpicture}
\end{center}

\end{document}

MWE

Auch die Linie hat eine schlechte Qualität, sie sieht pixelig aus:

Pixelige Linie

Weiß jemand, wie man einen Vektor der Länge erzeugt, 1oder was übersehe ich?

Einige interessante Links:

Danke!!

Antwort1

Ich hoffe, ich übersehe nichts Offensichtliches. Sie müssen in Ihrem linken Beispiel nur durch dividieren, sqrt(2)um zu erhalten:

\documentclass{article}
\usepackage[a4paper,margin=1in,footskip=0.25in]{geometry}

\usepackage{pgfplots}
\pgfplotsset{compat=1.15}

\begin{document}

\begin{center}
    \begin{tikzpicture}
        \begin{axis} [
                title={Normalizing},
                axis on top,
                axis lines=center,
                xlabel=$x$,
                ylabel=$y$,
                zlabel=$z$,
                ticklabel style={font=\tiny},
                view={115}{25}
            ]
            \addplot3[opacity=.5,surf,samples=21,variable=\t,variable y=\s,domain=0:2,y domain=0:90,z buffer=sort,colormap={red}{color=(red) color=(red)}] ({\t*cos(\s)*(sqrt(2)*.5)},{\t*cos(\s)*(sqrt(2)*.5)},{\t*sin(\s)});%Red S            
            \pgfmathsetmacro{\msq}{sqrt(1/2)}
            \addplot3[-stealth,variable=\t,samples at={0,\msq},samples y=0] ({1/2+t},{1/2-t},{1});
        \end{axis}
    \end{tikzpicture}
\end{center}
\end{document}

Bildbeschreibung hier eingeben

Die "Pixelbildung" verschwand nach dem Hinzufügensamples y=0 .

verwandte Informationen