Εμβαδόν μεταξύ καμπυλών

Συντονιστής: grigkost

Άβαταρ μέλους
Tolaso J Kos
Δημοσιεύσεις: 5226
Εγγραφή: Κυρ Αύγ 05, 2012 10:09 pm
Τοποθεσία: Λάρισα, Βαρκελώνη
Επικοινωνία:

Εμβαδόν μεταξύ καμπυλών

#1

Μη αναγνωσμένη δημοσίευση από Tolaso J Kos » Τετ Ιουν 02, 2021 9:22 pm

Ο παρακάτω κώδικας

Κώδικας: Επιλογή όλων

\begin{tikzpicture}
\draw[->] (-3, 0) -- (5, 0) node[below]{x};
\draw[->] (0, -2 ) -- (0, 4) node[left]{y};
\draw[fill=lightgray, domain=0:1] plot(\x, {sqrt(\x)} ) -- (1, 0) -- (0, 0);
\draw[line width=1.6pt, red] plot[smooth,domain=-2:2] (\x, {(\x)^2});
\draw[line width=1.6pt, cyan] plot[smooth,domain=0:4] (\x, {sqrt(\x)});
\draw[line width=1.6pt, cyan] plot[smooth,domain=0:4] (\x, {-sqrt(\x)});
\draw (0, 0) node[below left]{O};
\draw (1, 1) node[above left]{A};
\draw[draw=none , fill=white , domain=0:1] plot(\x, {(\x)^2} ) -- (1, 0) -- (0, 0);
\draw[black] (1, 0) -- (0, 0);
\end{tikzpicture}

παράγει το σχήμα

\displaystyle{\begin{tikzpicture} 
\draw[->] (-3, 0) -- (5, 0) node[below]{x}; 
\draw[->] (0, -2 ) -- (0, 4) node[left]{y}; 
\draw[fill=lightgray, domain=0:1] plot(\x, {sqrt(\x)} ) -- (1, 0) -- (0, 0); 
\draw[line width=1.6pt, red] plot[smooth,domain=-2:2] (\x, {(\x)^2}); 
\draw[line width=1.6pt, cyan] plot[smooth,domain=0:4] (\x, {sqrt(\x)}); 
\draw[line width=1.6pt, cyan] plot[smooth,domain=0:4] (\x, {-sqrt(\x)}); 
\draw (0, 0) node[below left]{O}; 
\draw (1, 1) node[above left]{A}; 
\draw[draw=none , fill=white , domain=0:1] plot(\x, {(\x)^2} ) -- (1, 0) -- (0, 0); 
\draw[black] (1, 0) -- (0, 0); 
\end{tikzpicture}}
Όπως βλέπετε υπάρχει μία ανεπιθύμητη γραμμή από το (1, 1) -- (1, 0). Παρόλο που χρησιμοποίησα την εντολή

Κώδικας: Επιλογή όλων

\draw=none
δε λέει να φύγει με τίποτα. Έχετε κανένα workaround ώστε αυτή η γραμμή ουσιαστικά να γίνει "αόρατη" ;


Υ.Σ 1: Για το κειμενογράφο προσθέστε όπου είναι απαραίτητο τα δολλάρια.

Υ.Σ 2: Δε θα ήθελα λύση με pgfplots και την εντολή \fillbetween.


Η φαντασία είναι σημαντικότερη από τη γνώση !
\displaystyle{{\color{blue}\mathbf{Life=\int_{birth}^{death}\frac{happiness}{time}\Delta time} }}

Λέξεις Κλειδιά:
Άβαταρ μέλους
Tolaso J Kos
Δημοσιεύσεις: 5226
Εγγραφή: Κυρ Αύγ 05, 2012 10:09 pm
Τοποθεσία: Λάρισα, Βαρκελώνη
Επικοινωνία:

Re: Εμβαδόν μεταξύ καμπυλών

#2

Μη αναγνωσμένη δημοσίευση από Tolaso J Kos » Πέμ Ιουν 03, 2021 12:50 pm

Tolaso J Kos έγραψε:
Τετ Ιουν 02, 2021 9:22 pm
\displaystyle{\begin{tikzpicture} 
\draw[->] (-3, 0) -- (5, 0) node[below]{x}; 
\draw[->] (0, -2 ) -- (0, 4) node[left]{y}; 
\draw[fill=lightgray, domain=0:1] plot(\x, {sqrt(\x)} ) -- (1, 0) -- (0, 0); 
\draw[line width=1.6pt, red] plot[smooth,domain=-2:2] (\x, {(\x)^2}); 
\draw[line width=1.6pt, cyan] plot[smooth,domain=0:4] (\x, {sqrt(\x)}); 
\draw[line width=1.6pt, cyan] plot[smooth,domain=0:4] (\x, {-sqrt(\x)}); 
\draw (0, 0) node[below left]{O}; 
\draw (1, 1) node[above left]{A}; 
\draw[draw=none , fill=white , domain=0:1] plot(\x, {(\x)^2} ) -- (1, 0) -- (0, 0); 
\draw[black] (1, 0) -- (0, 0); 
\end{tikzpicture}}

Βρέθηκε το culprit. Είναι η εντολή

Κώδικας: Επιλογή όλων

\draw[fill=lightgray, domain=0:1] plot(\x, {sqrt(\x)} ) -- (1, 0) -- (0, 0);
η οποία θέλει αντικατάσταση σε αυτή

Κώδικας: Επιλογή όλων

\draw[\draw=none, fill=lightgray, domain=0:1] plot(\x, {sqrt(\x)} ) -- (1, 0) -- (0, 0);
\displaystyle{ \begin{tikzpicture} 
    \fill[lightgray, domain=0:1] plot(\x, {sqrt(\x)} ) -- plot (1- \x, {(1-\x)*(1-\x)}); 
    \draw[->] (-3, 0) -- (5, 0) node[below]{x}; 
    \draw[->] (0, -2) -- (0, 4) node[left]{y}; 
    \draw[line width=1.6pt, red]  plot[smooth,domain=-2:2] (\x, \x*\x); 
    \draw[line width=1.6pt, cyan] plot[smooth,domain=-2:2] (\x*\x, \x); 
    \draw (0, 0) node[below left]{O}; 
    \draw (1, 1) node[above left]{A}; 
    \end{tikzpicture}}
Πάντως ευχαριστώ για τη βοήθεια.


Η φαντασία είναι σημαντικότερη από τη γνώση !
\displaystyle{{\color{blue}\mathbf{Life=\int_{birth}^{death}\frac{happiness}{time}\Delta time} }}
Απάντηση

Επιστροφή σε “Πακέτα και γραφή σε TeX-κειμενογράφο”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 5 επισκέπτες