- Questo topic ha 3 risposte, 2 partecipanti ed è stato aggiornato l'ultima volta 13 anni, 10 mesi fa da .
-
Topic
-
ho un problema con questi if annidati
in pratica la label T_5
mi appare due volte
ne vedete il motivo?grazie
claudio`
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{hobby}
\usetikzlibrary{decorations}
\usetikzlibrary{shapes,arrows,trees,positioning,through,intersections}
\usetikzlibrary{shapes.gates.logic.US,shapes.gates.logic.IEC}
\usepackage{xifthen}
\newcommand{\stampa}[3]{
\ifthenelse{#1=1}
{
\draw(0,0)–(\raggio,{\raggio*tan(#2)})node[above] {$#3$};
}
{
\ifthenelse{#1=2}
{
\draw(0,0)–(\raggio,{\raggio*tan(#2)})node[above right] {$#3$};
}
{
\ifthenelse{#1=3}
{
\draw(0,0)–(\raggio,{\raggio*tan(#2)})node[above left] {$#3$};
}
{
\ifthenelse{#1=4}
{
\draw(0,0)–(\raggio,{\raggio*tan(#2)})node[below] {$#3$};
}
{
\ifthenelse{#1=5}
{
\draw(0,0)–(\raggio,{\raggio*tan(#2)})node[below right] {$#3$};
}
{
\ifthenelse{#1=6}
}
{
\draw(0,0)–(\raggio,{\raggio*tan(#2)})node[below left] {$#3$};
}
}}}}}\begin{document}
\begin{tikzpicture}[>=triangle 45,scale=0.8] %, x=0.8cm,y=0.8cm]
% draw the coordinates\pgfmathsetmacro{\raggio}{4};
\pgfmathsetmacro{\mraggio}{\raggio/3};
\pgfmathsetmacro{\qraggio}{\raggio/5};
\pgfmathsetmacro{\sraggio}{1.9*\raggio};
% draw the unit circle
\draw[->] (0,-\raggio-\mraggio) — (0,\raggio+\mraggio+0.5) node[above,fill=white] {$y$};
\draw[->] (-\raggio-\mraggio,0) — (\raggio+\mraggio,0) node[right,fill=white] {$x$};
\draw[thick] (0,0) circle(\raggio);
\draw (\raggio,-\raggio-\mraggio) — (\raggio,\raggio+\mraggio+0.5);
\node(OO)at(0,0) [label= below right:$O$] {};\foreach \x/\z /\y in {
0/1/ T_1,
40/2/T_2,
140/3/T_3,
180/4/T_4,
210/5/T_5,
340/6/T_6
}
\stampa{\z}{\x}{\y};
\end{tikzpicture}\end{document}
`
- Devi essere connesso per rispondere a questo topic.