-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.tex
2632 lines (2369 loc) · 94.1 KB
/
sample.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%#!uplatex -shell-escape sample
%#!uplatex sample
%#LPR dvipdfmx -p a4 -r 1200 sample
% #LPR dvips -Ppdf -f sample.dvi | lpr
%#MAKEINDEX mendex -g -s mystyle.ist sample
%#!platex -shell-escape sample
%#!platex sample
%%% sudo tlmgr update --self --all
\documentclass[a4j,uplatex,dvipdfmx]{jsarticle}
\usepackage{amsmath}
\usepackage{emath}
\let\EMforeach=\foreach
\usepackage{graphicx,tikz}
\usetikzlibrary{arrows,shapes.symbols,decorations.pathreplacing,%
patterns,topaths,through,calc,intersections,%
shapes.geometric,shapes.misc,shapes.multipart}
%emathとmathabxを読み込む時のエラー対策
\let\therefore=\relax
\let\because=\relax
\usepackage{mathabx}
\usepackage{tikzsetup}
%\usepackage{newtxtext,newtxmath}
\makeatletter
%% \mytikzarc[option](中心){半径}{開始角}{終了角}
%% \mytikzarc*[option](中心){半径}{開始角}{終了角}
%% 中心・半径・開始角・終了角を指定して弧を描く
%% *をつけると弧と中心を結び扇形を描く
%% optionにはfillなどTikZのオプションをいれる.
\newif\ifmytikzoutline
\mytikzoutlinefalse
\define@key{mytikzarc}{sector}[true]{\mytikzoutlinetrue}%
\def\mytikzarc{\@ifstar{\@mytikzarc<sector>}{\@mytikzarc<>}}
\def\@mytikzarc<#1>{\@ifnextchar[{\@@mytikzarc<#1>}{\@@mytikzarc<#1>[]}}
\def\@@mytikzarc<#1>[#2](#3)#4#5#6{%
\def\@mytikz@arc@option{}%
\setkeys{mytikzarc}{#1}%
\ifmytikzoutline
\draw[#2] (#3)--($(#3)+(#5:#4)$) arc [start angle=#5,end angle=#6,radius=#4]--cycle;
\else
\draw[#2] ($(#3)+(#5:#4)$) arc [start angle=#5,end angle=#6,radius=#4];
\fi
\mytikzoutlinefalse
}%
%% \mytikzbunten<オプション1>[オプション2](端点1)(端点2){分割数}
%% 2点(端点1)(端点2)を結ぶ線分を<分割数>等分しこの線分と垂直な線分を各点に配置する
\define@key{mytikzbunten}{length}{\def\@mytikzbuntenlength{#1}}%default=1.5pt
\def\mytikzbunten{\@ifnextchar<{\@mytikzbunten}{\@mytikzbunten<>}}
\def\@mytikzbunten<#1>{\@ifnextchar[{\@@mytikzbunten<#1>}{\@@mytikzbunten<#1>[]}}
\def\@@mytikzbunten<#1>[#2](#3)(#4)#5{%
\def\@mytikzbuntenlength{1.5pt}%
\setkeys{mytikzbunten}{#1}%
\ISub{#5}{1}\@MTBLN
\foreach \NUM in {1,...,\@MTBLN}{%
\draw[#2] let \p1=($(#3)!\NUM/#5!(#4)$) in
(\x1,\y1)--($(\x1,\y1)!\@mytikzbuntenlength!90:(#4)$)
(\x1,\y1)--($(\x1,\y1)!\@mytikzbuntenlength!-90:(#4)$);
}%
}%
\makeatother
\begin{document}
\section{基本的なコマンド}
\begin{itemize}
\item \verb!\draw = \path[draw]!
\item \verb!\fill = \path[fill]!
\item \verb!\filldraw = \path[fill,draw] or \path [fill] [draw]]!
\item \verb!\pattern = \path[pattern]!
\item \verb!\shade = \path[shade]!
\item \verb!\shadedraw = \path[shade,draw]!
\item \verb!\clip = \path[clip]!
\item \verb!\useasboundingbox = \path[use as bouding box]!
\end{itemize}
\section{colorオプション}
\begin{itemize}
\item \verb@color=color1!number!color2@
\verb!color1:color2=number:(100-number)!の割合で色を塗る.
\verb@!color2@を省略すると\verb!white!と見做される.
\verb@!number!color2@を省略すると\verb!color1!のみで色を塗る.
\begin{center}
\begin{tikzpicture}
\draw [color=red!50!blue] (0,0)--(2,0);
\draw [fill,color=yellow!30] (0,.5) circle (.5cm);
\draw [fill,color=green] (1,.5) rectangle (1.5,1);
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw [color=red!50!blue] (0,0)--(2,0);
\draw [fill,color=yellow!30] (0,.5) circle (.5cm);
\draw [fill,color=green] (1,.5) rectangle (1.5,1);
\end{tikzpicture}
\end{verbatim}
\end{center}
\item \verb!\colorlet{color name}{color def}!で自由に色を定義できる.
\begin{center}
\colorlet{hogehoge}{blue!25!yellow}
\tikz \draw[fill,color=hogehoge] (0,0) circle (1em);
\begin{verbatim}
\colorlet{hogehoge}{blue!25!yellow}
\tikz \draw[fill,color=hogehoge] (0,0) circle (1em);
\end{verbatim}
\end{center}
\end{itemize}
\section{関数の描画}
\begin{itemize}
\item \verb@plot[local option] coordinate {(coord1)(coord2)...(coordn)}@
この指定方法は
\verb@\draw[local option] (coord1)--(coord2)--...--(coordn)@
と同じである.
\tikz \draw plot coordinates {(0,0)(1,0)(1,1)(-30:2)};
\verb@\tikz \draw plot coordinates {(0,0)(1,0)(1,1)(-30:2)};@
\item \verb@plot[local option] file {file name}@
これはすでに作成済みの\[email protected]@ファイルから座標を読み込むものである.
必要ならばマニュアルの224ページを参照すること.
\item \verb@plot[local option] (coordinate expression)@
関数式の指定で任意の関数を描画する方法.
\begin{itemize}
\item \verb@variable=macro@
関数の変数を指定する.
defaultでは\verb@\x@である.
\item \verb@samples=number@
描画に使用する制御点の個数を指定する.
defaultでは\verb@25@である.
\item \verb@domain=start:end@
関数の定義域を指定する.
defaultでは\verb@start=-5@,\verb@end=5@である.
\item \verb@samples at={sample list}@
制御点のうちどれを使用するかを指定する.
\end{itemize}
\begin{tikzpicture}[domain=0:4,>=stealth]
\scriptsize
\draw[very thin,color=gray](-0.1,-1.1)grid(3.9,3.9);
\draw[->](-.2,0)--(4.2,0)node[xshift=-3pt,yshift=-4pt]{$x$};
\draw[->](0,-.2)--(0,4.2)node[xshift=-4pt,yshift=-3pt]{$y$};
\draw[color=red]plot(\x,\x)node[right]{$y=x$};
\draw[color=blue]plot(\x,{sin(\x r)})node[right]{$y=\sin x$};
\draw[color=orange]plot(\x,{exp(\x)*1/20})node[right]{$y=\Frac1{20}e^x$};
\draw[scale=0.5,domain=-3.1415:3.1415,smooth,variable=\t]
plot({\t*sin(\t r)},{\t*cos(\t r)})node[left]{$C$};
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[domain=0:4,>=stealth]
\scriptsize
\draw[very thin,color=gray](-0.1,-1.1)grid(3.9,3.9);
\draw[->](-.2,0)--(4.2,0)node[xshift=-3pt,yshift=-4pt]{$x$};
\draw[->](0,-.2)--(0,4.2)node[xshift=-4pt,yshift=-3pt]{$y$};
\draw[color=red]plot(\x,\x)node[right]{$y=x$};
\draw[color=blue]plot(\x,{sin(\x r)})node[right]{$y=\sin x$};
\draw[color=orange]plot(\x,{exp(\x)*1/20})node[right]{$y=\Frac1{20}e^x$};
\draw[scale=0.5,domain=-3.1415:3.1415,smooth,variable=\t]
plot({\t*sin(\t r)},{\t*cos(\t r)})node[left]{$C$};
\end{tikzpicture}
\end{verbatim}
\item \verb@plot[local option] function {gunplot formula}@
この指定方法は\verb@--shell-escape@オプションが必要になり,
\verb@\jobname.idname.gnuplot@および\verb@\jobname.idname.table@という
補助ファイルが作られる.
\begin{itemize}
\item \verb@parametric=true or false@
媒介変数を使用するかどうかを指定する.
defaultで\verb@true@であり,
\verb@parametric@とすると自動で\verb@true@が適用される.
\item \verb@id=idname@
補助ファイルは基本的に\verb@\jobname.idname.gnuplot@,
\verb@\jobname.idname.table@という書式であるが,
この\verb@idname@の部分を指定する.
通常は一意の名称を使用する.
\item \verb@row gnuplot@
\item \verb@evry plot@
すべてのプロットで使用するスタイルなどを指定する.
例えば,補助ファイルをすべて\verb@./plots@ディレクトリに作成する場合は
ex:\verb@\tikzset{every plot/.style={prefix=plots/}}@
と設定する.
\end{itemize}
\begin{tikzpicture}[domain=0:4,>=stealth]
\scriptsize
\draw[very thin,color=gray](-0.1,-1.1)grid(3.9,3.9);
\draw[->](-.2,0)--(4.2,0)node[xshift=-3pt,yshift=-4pt]{$x$};
\draw[->](0,-.2)--(0,4.2)node[xshift=-4pt,yshift=-3pt]{$y$};
\draw[color=red]plot[id=tikz-sample-function-x]
function{x}node[right]{$y=x$};
\draw[color=blue]plot[id=tikz-sample-function-sin]
function{sin(x)}node[right]{$y=\sin x$};
\draw[color=orange]plot[id=tikz-sample-function-exp]
function{exp(x)*1/20}node[right]{$y=\Frac1{20}e^x$};
\draw[scale=0.5,domain=-3.1415:3.1415,smooth,parametric,%
id=tikz-sample-function-param]
plot function{t*sin(t),t*cos(t)}node[left]{$C$};
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[domain=0:4,>=stealth]
\scriptsize
\draw[very thin,color=gray](-0.1,-1.1)grid(3.9,3.9);
\draw[->](-.2,0)--(4.2,0)node[xshift=-3pt,yshift=-4pt]{$x$};
\draw[->](0,-.2)--(0,4.2)node[xshift=-4pt,yshift=-3pt]{$y$};
\draw[color=red]plot[id=tikz-sample-function-x]
function{x}node[right]{$y=x$};
\draw[color=blue]plot[id=tikz-sample-function-sin]
function{sin(x)}node[right]{$y=\sin x$};
\draw[color=orange]plot[id=tikz-sample-function-exp]
function{exp(x)*1/20}node[right]{$y=\Frac1{20}e^x$};
\draw[scale=0.5,domain=-3.1415:3.1415,smooth,parametric,%
id=tikz-sample-function-param]
plot function{t*sin(t),t*cos(t)}node[left]{$C$};
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\section{線の描画}
\subsection{線の太さの数値による指定}
\begin{itemize}
\item \verb@line width=dimension@
\verb@dimension@に単位付き数値で指定する.
defaultは0.4pt (thin)である.
\tikz \draw[line width=10pt] (0,0)--(1,0);
\verb@\tikz \draw[line width=10pt] (0,0)--(1,0);@
\end{itemize}
\subsection{線の太さの名前による指定}
\begin{itemize}
\item \verb@ultra thin@:線に太さを0.1ptに設定する.
\tikz \draw[ultra thin] (0,0)--(1,0);
\verb@\tikz \draw[ultra thin] (0,0)--(1,0);@
\item \verb@very thin@:線に太さを0.2ptに設定する.
\tikz \draw[very thin] (0,0)--(1,0);
\verb@\tikz \draw[very thin] (0,0)--(1,0);@
\item \verb@thin@:線に太さを0.4ptに設定する.
\tikz \draw[thin] (0,0)--(1,0);
\verb@\tikz \draw[thin] (0,0)--(1,0);@
\item \verb@semithick@:線の太さを0.6ptに設定する.
\tikz \draw[semithick] (0,0)--(1,0);
\verb@\tikz \draw[semithick] (0,0)--(1,0);@
\item \verb@thick@:線の太さを0.8ptに設定する.
\tikz \draw[thick] (0,0)--(1,0);
\verb@\tikz \draw[thick] (0,0)--(1,0);@
\item \verb@very thick@:線の太さを1.2ptに設定する.
\tikz \draw[very thick] (0,0)--(1,0);
\verb@\tikz \draw[very thick] (0,0)--(1,0);@
\item \verb@ultra thick@:線の太さを1.6ptに設定する.
\tikz \draw[ultra thick] (0,0)--(1,0);
\verb@\tikz \draw[ultra thick] (0,0)--(1,0);@
\end{itemize}
\subsection{線の端末の処理}
\begin{itemize}
\item \verb@line cap=type@
\verb@type@には,``\verb@round@'',``\verb@rect@'',``\verb@butt@''の3種類があり,
defaultは\verb@butt@であり両端点は与えられた始点および終点の場所で終わる.
\verb@rect@は\verb@butt@の両端に線の太さの半分だけ長方形が付け加えられる.
\verb@round@は\verb@butt@の両端に線の太さの半分の半円が付け加えられる.
\begin{tikzpicture}
\draw[color=green] (0,-.5)--(0,1.5) (1,-.5)--(1,1.5);
\begin{scope}[line width=10pt]
\draw[line cap=round] (0,0)--(1,0);
\draw[line cap=rect] (0,.5)--(1,0.5);
\draw[line cap=butt] (0,1)--(1,1);
\end{scope}
\draw[color=white,line width=1pt] (0,0)--(1,0) (0,.5)--(1,.5) (0,1)--(1,1);
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[color=green] (0,-.5)--(0,1.5) (1,-.5)--(1,1.5);
\begin{scope}[line width=10pt]
\draw[line cap=round] (0,0)--(1,0);
\draw[line cap=rect] (0,.5)--(1,0.5);
\draw[line cap=butt] (0,1)--(1,1);
\end{scope}
\draw[color=white,line width=1pt] (0,0)--(1,0) (0,.5)--(1,.5) (0,1)--(1,1);
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\subsection{線分の繋ぎ方}
\begin{itemize}
\item \verb@line join=type@
\verb@type@には,``round'',``bevel'',``miter''の3種類あり,
defaultは``miter''である.\vspace{1zh}
\begin{tikzpicture}[line width=10pt]
\draw[line join=round] (0,0)--++(.5,1)--++(.5,-1);
\draw[line join=bevel] (1.5,0)--++(.5,1)--++(.5,-1);
\draw[line join=miter] (3,0)--++(.5,1)--++(.5,-1);
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[line width=10pt]
\draw[line join=round] (0,0)--++(.5,1)--++(.5,-1);
\draw[line join=bevel] (1.5,0)--++(.5,1)--++(.5,-1);
\draw[line join=miter] (3,0)--++(.5,1)--++(.5,-1);
\end{tikzpicture}
\end{verbatim}
また,default(\verb@miter@)かつ非常に鋭角なコーナーのとき,
折れ点から伸ばす部分が線の太さの10倍になると自動で\verb@bevel@になるようにしてある.
これを変更するには\verb@miter limit@オプションで変更する.
defalutでは\verb@10@が設定してある.
\begin{tikzpicture}[line width=5pt]
\draw (0,0)--++(5,.5)--++(-5,.5);
\draw[miter limit=25] (6,0)--++(5,.5)--++(-5,.5);
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[line width=5pt]
\draw (0,0)--++(5,.5)--++(-5,.5);
\draw[miter limit=25] (6,0)--++(5,.5)--++(-5,.5);
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\subsection{破線の数値による指定}
\begin{itemize}
\item \verb@dash pattern=pattern@
\verb@pattern@に具体的に破線の使用を記述する.
\tikz \draw[dash pattern=on 2pt off 3pt on 4pt off 4pt]
(0pt,0pt)--(3.5cm,0pt);\\
\verb@\tikz \draw[dash pattern=on 2pt off 3pt on 4pt off 4pt](0pt,0pt)--(3.5cm,0pt);@
\item \verb@dash phase=dimension@
破線の開始を\verb@dimension@の分だけずらす.
defaultでは\verb@0pt@.
\begin{tikzpicture}[dash pattern=on 20pt off 10pt]
\draw[dash phase=0pt] (0pt,3pt)--(3.5cm,3pt);
\draw[dash phase=10pt] (0pt,0pt)--(3.5cm,0pt);
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[dash pattern=on 20pt off 10pt]
\draw[dash phase=0pt] (0pt,3pt)--(3.5cm,3pt);
\draw[dash phase=10pt] (0pt,0pt)--(3.5cm,0pt);
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\subsubsection{破線・点線の名前による指定}
\begin{itemize}
\item \verb@solid@
\tikz \draw[solid] (0,0)--(2,0);
\verb@\tikz \draw[solid] (0,0)--(2,0);@
\item \verb@dotted@
\tikz \draw[dotted] (0,0)--(2,0);
\verb@\tikz \draw[dotted] (0,0)--(2,0);@
\item \verb@densely dotted@
\tikz \draw[densely dotted] (0,0)--(2,0);
\verb@\tikz \draw[densely dotted] (0,0)--(2,0);@
\item \verb@loosely dotted@
\tikz \draw[loosely dotted] (0,0)--(2,0);
\verb@\tikz \draw[loosely dotted] (0,0)--(2,0);@
\item \verb@dashed@
\tikz \draw[dashed] (0,0)--(2,0);
\verb@\tikz \draw[dashed] (0,0)--(2,0);@
\item \verb@densely dashed@
\tikz \draw[densely dashed] (0,0)--(2,0);
\verb@\tikz \draw[densely dashed] (0,0)--(2,0);@
\item \verb@loosely dashed@
\tikz \draw[loosely dashed] (0,0)--(2,0);
\verb@\tikz \draw[loosely dashed] (0,0)--(2,0);@
\item \verb@dashdotted@
\tikz \draw[dashdotted] (0,0)--(2,0);
\verb@\tikz \draw[dashdotted] (0,0)--(2,0);@
\item \verb@densely dashdotted@
\tikz \draw[densely dashdotted] (0,0)--(2,0);
\verb@\tikz \draw[densely dashdotted] (0,0)--(2,0);@
\item \verb@loosely dashdotted@
\tikz \draw[loosely dashdotted] (0,0)--(2,0);
\verb@\tikz \draw[loosely dashdotted] (0,0)--(2,0);@
\item \verb@dashdotdotted@
\tikz \draw[dashdotdotted] (0,0)--(2,0);
\verb@\tikz \draw[dashdotdotted] (0,0)--(2,0);@
\item \verb@densely dashdotdotted@
\tikz \draw[densely dashdotdotted] (0,0)--(2,0);
\verb@\tikz \draw[densely dashdotdotted] (0,0)--(2,0);@
\item \verb@loosely dashdotdotted@
\tikz \draw[loosely dashdotdotted] (0,0)--(2,0);
\verb@\tikz \draw[loosely dashdotdotted] (0,0)--(2,0);@
\end{itemize}
\subsection{矢線の設定}
\begin{itemize}
\item \verb@arrows=<start arrow kind>-<end arrow kind>@
\verb@-@の前後にそれぞれ矢線の始点・終点の形状を指定する.
\verb@\usetikzlibrary@で\verb@arrows@を読み込んでおくと様々な矢線の形状を利用できるようになる.
\begin{itemize}
\item \tikz \draw[to-to] (0,0)--(1,0);
\verb@\tikz \draw[to-to] (0,0)--(1,0);@
\item \tikz \draw[to reversed-to reversed] (0,0)--(1,0);
\verb@\tikz \draw[to reversed-to reversed] (0,0)--(1,0);@
\item \tikz \draw[implies-implies] (0,0)--(1,0);
\verb@\tikz \draw[implies-implies] (0,0)--(1,0);@
\item \tikz \draw[double,implies-implies] (0,0)--(1,0);
\verb@\tikz \draw[double,implies-implies] (0,0)--(1,0);@
\item \tikz \draw[<->] (0,0)--(1,0);
\verb@\tikz \draw[<->] (0,0)--(1,0);@
\item \tikz \draw[>-<] (0,0)--(1,0);
\verb@\tikz \draw[>-<] (0,0)--(1,0);@
\item \tikz \draw[<<->>] (0,0)--(1,0);
\verb@\tikz \draw[<<->>] (0,0)--(1,0);@
\item \tikz \draw[>>-<<] (0,0)--(1,0);
\verb@\tikz \draw[>>-<<] (0,0)--(1,0);@
\item \tikz \draw[|<->|] (0,0)--(1,0);
\verb@\tikz \draw[|<->|] (0,0)--(1,0);@
\item \tikz \draw[latex-latex] (0,0)--(1,0);
\verb@\tikz \draw[latex-latex] (0,0)--(1,0);@
\item \tikz \draw[latex reversed-latex reversed] (0,0)--(1,0);
\verb@\tikz \draw[latex reversed-latex reversed] (0,0)--(1,0);@
\item \tikz \draw[stealth-stealth] (0,0)--(1,0);
\verb@\tikz \draw[stealth-stealth] (0,0)--(1,0);@
\item \tikz \draw[stealth reversed-stealth reversed] (0,0)--(1,0);
\verb@\tikz \draw[stealth reversed-stealth reversed] (0,0)--(1,0);@
\item \tikz \draw[o-o] (0,0)--(1,0);
\verb@\tikz \draw[o-o] (0,0)--(1,0);@
\item \tikz \draw[*-*] (0,0)--(1,0);
\verb@\tikz \draw[*-*] (0,0)--(1,0);@
\item \tikz \draw[diamond-diamond] (0,0)--(1,0);
\verb@\tikz \draw[diamond-diamond] (0,0)--(1,0);@
\item \tikz \draw[open diamond-open diamond] (0,0)--(1,0);
\verb@\tikz \draw[open diamond-open diamond] (0,0)--(1,0);@
\item \tikz \draw[square-square] (0,0)--(1,0);
\verb@\tikz \draw[square-square] (0,0)--(1,0);@
\item \tikz \draw[open square-open square] (0,0)--(1,0);
\verb@\tikz \draw[open square-open square] (0,0)--(1,0);@
\end{itemize}
\end{itemize}
\section{円・弧の描画}
\begin{itemize}
\item \verb@coordinate circle [radius=dimension]@
\verb@coordinate@を中心として半径\verb@dimension@の円を描く.
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\draw (1,1) circle [radius=1cm];
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\draw (1,1) circle [radius=1cm];
\end{tikzpicture}
\end{verbatim}
\item \verb@coordinate arc [start angle=degree1,end angle=degree2,radius=dimension]@
\verb@coordinate@を始点とした半径\verb@dimension@,開始角\verb@degree1@,
終了角\verb@degree2@の弧を描く.
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\draw (2,1) arc [start angle=0,end angle=60,radius=1cm];
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\draw (2,1) arc [start angle=0,end angle=60,radius=1cm];
\end{tikzpicture}
\end{verbatim}
\verb@start angle@または\verb@end angle@のどちらか一方と
\verb@delta angle=degree@として中心角を指定する方法もある.
また,\verb@radius@の代わりに\verb@x radius@,\verb@y radius@を使用すると楕円の弧となる.
ただし,このままで非常に使いにくいから
\verb@\mytikzarc[option](中心){半径}{開始角}{終了角}@
というコマンドを自作した.
コマンドのすぐ後ろに\verb@*@をつけると弧と中心を結んだ扇形を描く.
\verb@option@は\verb@\draw@のオプションである.
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\mytikzarc*[fill,blue,opacity=.5](2,1){1cm}{30}{120}
\mytikzarc[fill,red,opacity=.5](45:1){.5cm}{-45}{45}
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\mytikzarc*[fill,blue,opacity=.5](2,1){1cm}{30}{120}
\mytikzarc[fill,red,opacity=.5](45:1){.5cm}{-45}{45}
\end{tikzpicture}
\end{verbatim}
\verb@sector@を省略して\verb@fill@を指定すると扇形ではなく弓形の塗りつぶしとなる.
\item \verb@\draw coordinate1 to [out=degree1,in=degree2] coordinate2@
2点\verb@coordinate1@,\verb@coordinate2@を結ぶ線分と角度\verb@degree1@で
点\verb@coordinate1@から出発して点\verb@coordinate2@へ角度\verb@degree2@で
到着する滑らなかな曲線を描く.
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\draw(0,0) to [out=30,in=150] (3,0);
\draw(3,1) to [out=30,in=150] (0,1);
\draw(3,2) to [out=-150,in=-30] (0,2);
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\draw(0,0) to [out=30,in=150] (3,0);
\draw(3,1) to [out=30,in=150] (0,1);
\draw(3,2) to [out=-150,in=-30] (0,2);
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\section{点および交点の設定}
\subsection{点の設定}
\begin{itemize}
\item \verb@\coordinate (点の名前) at (座標)@
\verb@\path coordinate@の短縮形.
\verb@\draw@などで線を引いている途中でも\verb@(座標) coordinate (点の名前)@で
点の名前を設定できる.
\begin{tikzpicture}[line width=1pt]
\draw[gray,very thin](0,0)grid(3,2);
\coordinate (O) at (0,0);
\draw(0,1)--(3,1) coordinate (A)--(1,0);
\draw(O)--(A);
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[line width=1pt]
\draw[gray,very thin](0,0)grid(3,2);
\coordinate (O) at (0,0);
\draw(0,1)--(3,1) coordinate (A)--(1,0);
\draw(O)--(A);
\end{tikzpicture}
\end{verbatim}
\item \verb@\node [オプション] (点の名前) at (座標) {ラベル}@
\verb@\path node@の短縮形.
\verb@\draw@などで線を引いている途中でも\verb@(座標) node [オプション] (点の名前) {ラベル}@
で点の名前などを設定できる.
\verb@node@には形・大きさが存在する.
\verb@coordinate@は大きさが0の\verb@node@である.
\begin{tikzpicture}[line width=1pt]
\draw[gray,very thin](0,0)grid(3,2);
\node (O) at (0,0) {O};
\node (A) at (2,1) {A};
\draw (O)--(A)--(3,0);
% \draw (O)--(2,1) node [blue] (A) {A}--(3,0);
\end{tikzpicture}
\begin{itemize}
\item 位置
\begin{itemize}
\item \verb@above@,\verb@below@,\verb@right@,\verb@left@
それぞれ指定した座標の上,下,右,左に\verb@node@を設定する.
座標に名前をつけてその上,下,右,左にラベルを表示するのではないことに注意.
\begin{tikzpicture}[line width=1pt]
\draw[gray,very thin](0,0)grid(3,2);
\node[fill,red!20,opacity=.5,text=black](O)at(0,0)[below]{O};
\node[fill,red!20,opacity=.5,text=black](A)at(3,1)[above]{A};
\draw(O)--(A);
\fill[blue](O.north)circle[radius=1pt](A.south)circle[radius=1pt];
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[line width=1pt]
\draw[gray,very thin](0,0)grid(3,2);
\node[fill,red!20,opacity=.5,text=black](O)at(0,0)[below]{O};
\node[fill,red!20,opacity=.5,text=black](A)at(3,1)[above]{A};
\draw(O)--(A);
\fill[blue](O.north)circle[radius=1pt](A.south)circle[radius=1pt];
\end{tikzpicture}
\end{verbatim}
\item \verb@anchor=north,south,east,west@
それぞれ指定した座標に\verb@node@の
北,南,東,西が重なるように\verb@node@を設定する.
\begin{tikzpicture}[line width=1pt]
\draw[gray,very thin](0,0)grid(3,2);
\node[fill,red!20,opacity=.5,text=black](O)at(0,0)[anchor=south]{O};
\node[fill,red!20,opacity=.5,text=black](A)at(3,1)[anchor=north]{A};
\draw(O)--(A);
\fill[blue](O.south)circle[radius=1pt](A.north)circle[radius=1pt];
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[line width=1pt]
\draw[gray,very thin](0,0)grid(3,2);
\node[fill,red!20,opacity=.5,text=black](O)at(0,0)[anchor=south]{O};
\node[fill,red!20,opacity=.5,text=black](A)at(3,1)[anchor=north]{A};
\draw(O)--(A);
\fill[blue](O.south)circle[radius=1pt](A.north)circle[radius=1pt];
\end{tikzpicture}
\end{verbatim}
\item \verb@ノード名.north,south,east,west@
\begin{tikzpicture}
\draw(0,0)grid(3,2);
\node[fill,red!20,text=black](A)at(2,1){A};
\scriptsize
\path node at(A.north){N} node at(A.south){S};
\node at(A.west){W};
\node at(A.east){E};
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw(0,0)grid(3,2);
\node[fill,red!20,text=black](A)at(2,1){A};
\scriptsize
\path node at(A.north){N} node at(A.south){S};
\node at(A.west){W};
\node at(A.east){E};
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\item ラベル
オプションで\verb@label=位置:ラベル@と指定してラベルの位置をずらす.
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\node[fill,red!20,opacity=.5,text=black](O)at(0,0)[label=south:O]{};
\node[fill,red!20,opacity=.5,text=black](A)at(3,1)[label=north:A]{};
\node[fill,red!20,opacity=.5,text=black](B)at(2,2)[label=below:B]{};
\draw(O)--(A);
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\node[fill,red!20,opacity=.5,text=black](O)at(0,0)[label=south:O]{};
\node[fill,red!20,opacity=.5,text=black](A)at(3,1)[label=north:A]{};
\node[fill,red!20,opacity=.5,text=black](B)at(2,2)[label=below:B]{};
\draw(O)--(A);
\end{tikzpicture}
\end{verbatim}
ただし,\verb@node@には大きさがあるので上記のように2つの\verb@node@を線で結ぶと
\verb@node@の近辺は描かれない.
そこで下記のように\verb@coordinate@を使ってラベルと配置したほうが良いだろう.
\verb@inner sep@を設定することによって点とラベルとの距離も任意に設定できる.
ただし,\verb@label=num:label@と指定することもできるが(\verb@num@は角度),
この場合は\verb@inner sep@での指定は効果が無いようである.
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\coordinate (O) at (0,0);
\coordinate (A) at (3,1);
\draw (O)--(A);
\node[label=-135:{\scriptsize O},inner sep=0pt] at (O){};
\node[anchor=south,inner sep=2pt] at (A){\scriptsize A};
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\coordinate (O) at (0,0);
\coordinate (A) at (3,1);
\draw (O)--(A);
\node[label=-135:{\scriptsize O},inner sep=0pt] at (O){};
\node[anchor=south,inner sep=2pt] at (A){\scriptsize A};
\end{tikzpicture}
\end{verbatim}
\item 形状
\verb@circle@,\verb@rectangle@,\verb@coordinate@
の3種類が設定可能.デフォルトは\verb@rectangle@であり,
ライブラリで拡張可能である.
オプションに\verb@draw@をつけると輪郭が描かれ,
\verb@fill@をつけると内部が塗りつぶされる.
また,\verb@inner sep=dimension@で
\verb@node@内のラベルと外枠との距離を指定できる.
デフォルトは\[email protected]@である.
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\node[draw,red!20,opacity=.5,text=black](O)at(0,0){O};
\node[fill,red!20,opacity=.5,text=black](A)at(1,1){A};
\node[fill,circle,red!20,opacity=.5,text=black](B)at(2,2){B};
\node[fill,coordinate,red!20,opacity=.5,text=black](C)at(3,1){C};
\node[fill,circle,inner sep=0pt,red!20,opacity=.5,text=black](D)at(3,0){D};
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\node[draw,red!20,opacity=.5,text=black](O)at(0,0){O};
\node[fill,red!20,opacity=.5,text=black](A)at(1,1){A};
\node[fill,circle,red!20,opacity=.5,text=black](B)at(2,2){B};
\node[fill,coordinate,red!20,opacity=.5,text=black](C)at(3,1){C};
\node[fill,circle,inner sep=0pt,red!20,opacity=.5,text=black](D)at(3,0){D};
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\item 内分点・外分点など
\begin{itemize}
\item \verb@$(A)!num!(B)$@で
線分ABを$\mathtt{num}:(1-\mathtt{num})$に内分($0<\mathtt{num}<1$なら内分点,
$\mathtt{num}<0$または$1<\mathtt{num}$ならば外分点)する点を表す.
別の言い方をすれば,$\mathtt{num}\times\Vec{AB}$の端点を表す.
\item \verb@$(A)!num!angle:(B)$@では
$\Vec{AB}$を\verb@num@倍したものを点Aを中心として\verb@angle@回転させた端点を表す.
\item \verb@$(A)!dim!(B)$@とすると
線分AXの長さが\verb@dim@となる直線AB上の点Xを表す.
これは\verb@$(A)!num!angle:(B)$@と同様に回転させることもできる.
\item \verb@$(A)!(P)!(B)$@は
点Pから直線ABに下ろした垂線の足の座標を表す.
\end{itemize}
\begin{tikzpicture}
\draw[help lines] (0,-1)grid(3,1);
\coordinate (A) at (0,0);
\coordinate (B) at (3,0);
\coordinate (C) at ($(A)!.3!(B)$);
\draw(A)--(B);
\foreach \num in {.1,.2,...,.9}
\draw($(A)!\num!(B)+(0,-.1)$)--($(A)!\num!(B)+(0,.1)$);
\foreach \point in {A,B,C}{
\fill[red,opacity=.5] (\point) circle [radius=2pt];
\node at(\point)[below]{\scriptsize\point};
}
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[help lines] (0,-1)grid(3,1);
\coordinate (A) at (0,0);
\coordinate (B) at (3,0);
\coordinate (C) at ($(A)!.3!(B)$);
\draw(A)--(B);
\foreach \num in {.1,.2,...,.9}
\draw($(A)!\num!(B)+(0,-.1)$)--($(A)!\num!(B)+(0,.1)$);
\foreach \point in {A,B,C}{
\fill[red,opacity=.5] (\point) circle [radius=2pt];
\node at(\point)[below]{\scriptsize\point};
}
\end{tikzpicture}
\end{verbatim}
\begin{tikzpicture}
\draw[help lines] (0,-1)grid(3,1);
\coordinate (A) at (0,0);
\coordinate (B) at (1,0);
\coordinate (C) at ($(A)!3!(B)$);
\draw(A)--(B);
\foreach \point in {A,B,C}{
\fill[red,opacity=.5] (\point) circle [radius=2pt];
\node at(\point)[below]{\scriptsize\point};
}
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[help lines] (0,-1)grid(3,1);
\coordinate (A) at (0,0);
\coordinate (B) at (1,0);
\coordinate (C) at ($(A)!3!(B)$);
\draw(A)--(B);
\foreach \point in {A,B,C}{
\fill[red,opacity=.5] (\point) circle [radius=2pt];
\node at(\point)[below]{\scriptsize\point};
}
\end{tikzpicture}
\end{verbatim}
\begin{tikzpicture}[>=stealth,line width=1pt]
\draw[help lines](0,0)grid(3,2);
\coordinate[label=left:A](A) at (0,1);
\coordinate[label=left:B](B) at (0,0);
\coordinate[label=right:C](C) at ($(A)!3!90:(B)$);
\foreach \point in {A,B,C}{
\fill[red,opacity=.5](\point)circle[radius=2pt];
}
\draw[->](A)--(B);
\draw[->](A)--(C);
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[>=stealth,line width=1pt]
\draw[help lines](0,0)grid(3,2);
\coordinate[label=left:A](A) at (0,1);
\coordinate[label=left:B](B) at (0,0);
\coordinate[label=right:C](C) at ($(A)!3!90:(B)$);
\foreach \point in {A,B,C}{
\fill[red,opacity=.5](\point)circle[radius=2pt];
}
\draw[->](A)--(B);
\draw[->](A)--(C);
\end{tikzpicture}
\end{verbatim}
さらに,次のように繰り返し使うこともできる.
\begin{tikzpicture}
\coordinate[label=left:A](A)at(0,0);
\coordinate[label=right:B](B)at(2,1);
\coordinate[label=above:C](C)at($(A)!.5!(B)!{sin(60)*2}!90:(B)$);
\draw(A)--(B)--(C)--cycle;
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\coordinate[label=left:A](A)at(0,0);
\coordinate[label=right:B](B)at(2,1);
\coordinate[label=above:C](C)at($(A)!.5!(B)!{sin(60)*2}!90:(B)$);
\draw(A)--(B)--(C)--cycle;
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\subsection{交点の設定}
\begin{itemize}
\item 直交する2直線の交点
\verb@((Pの座標)|-(Qの座標))@
Pを通る垂直線とQを通る水平線との交点.
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\coordinate(P)at(0,1);
\coordinate(Q)at(2,2);
\node at (P){P};
\node at (Q){Q};
\fill(P|-Q) circle [radius=2pt];
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\coordinate(P)at(0,1);
\coordinate(Q)at(2,2);
\node at (P){P};
\node at (Q){Q};
\fill(P|-Q) circle [radius=2pt];
\end{tikzpicture}
\end{verbatim}
\verb@((Pの座標)-|(Qの座標))@
Pを通る水平線とQを通る垂直線との交点.
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\coordinate(P)at(0,1);
\coordinate(Q)at(2,2);
\node at (P){P};
\node at (Q){Q};
\fill(P-|Q) circle [radius=2pt];
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[gray,very thin](0,0)grid(3,2);
\coordinate(P)at(0,1);
\coordinate(Q)at(2,2);
\node at (P){P};
\node at (Q){Q};
\fill(P-|Q) circle [radius=2pt];
\end{tikzpicture}
\end{verbatim}
\item 任意のパスの交点
異なる2つのパスに\verb@name path=path1@と\verb@name path=path2@を設定し,
\verb@name intersections=@
\verb@{of=path1 and path2}@で交点を設定する.
交点の名前はデフォルトでは\verb@intersection-1@,\verb@intersection-2@,$\ldots$と
つけられるが,\verb@name intersections@の引数に
\verb@by={A,B,C,...}@と指定することもできる.
\begin{tikzpicture}[>=stealth]
\draw[->](-2,0)--(2,0) node [below left]{\scriptsize$x$};
\draw[->](0,-1.5)--(0,3) node [below left]{\scriptsize$y$};
\draw[name path=para] plot [domain=-2:2] (\x,{pow(\x,2)-1});
\draw[name path=circ] (0,0) circle [radius=1];
\path [name intersections={of=para and circ,by={A,B,C}}];
\fill (A) circle [radius=2pt] (B) circle [radius=2pt] (C) circle [radius=2pt];
\node at (A)[below left]{A};
\node at (B)[below right]{B};
\node at (C)[below right]{C};
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[>=stealth]
\draw[->](-2,0)--(2,0) node [below left]{\scriptsize$x$};
\draw[->](0,-1.5)--(0,3) node [below left]{\scriptsize$y$};
\draw[name path=para] plot [domain=-2:2] (\x,{pow(\x,2)-1});
\draw[name path=circ] (0,0) circle [radius=1];
\path [name intersections={of=para and circ,by={A,B,C}}];
\fill (A) circle [radius=2pt] (B) circle [radius=2pt] (C) circle [radius=2pt];
\node at (A)[below left]{A};
\node at (B)[below right]{B};
\node at (C)[below right]{C};
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\section{Coordinate Systems}
\subsection{Canvas, XYZ, and Polar Coordinate Systems}
\subsubsection{Coordinate system canvas}
\begin{itemize}
\item \verb@canvas cs:x@,\verb@canvas cs:y@
それぞれ原点からの$x$軸,$y$軸方向への距離を指定する.
\begin{tikzpicture}
\draw[help lines](0,0)grid(3,2);
\fill(canvas cs:x=1cm,y=1.5cm)circle[radius=2pt];
\fill(canvas cs:x=2cm,y=-5mm+2pt)circle[radius=2pt];
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[help lines](0,0)grid(3,2);
\fill(canvas cs:x=1cm,y=1.5cm)circle[radius=2pt];
\fill(canvas cs:x=2cm,y=-5mm+2pt)circle[radius=2pt];
\end{tikzpicture}
\end{verbatim}
これらの指定は,コンマで区切られた2つの dimension を使って簡単に記述することができる.
\begin{tikzpicture}
\draw[help lines](0,0)grid(3,2);
\fill(1cm,1.5cm)circle[radius=2pt];
\fill(2cm,-5mm+2pt)circle[radius=2pt];
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}
\draw[help lines](0,0)grid(3,2);
\fill(1cm,1.5cm)circle[radius=2pt];
\fill(2cm,-5mm+2pt)circle[radius=2pt];
\end{tikzpicture}
\end{verbatim}
\end{itemize}
\subsubsection{Coordinate system xyz}
\begin{itemize}
\item \verb@xyz cs:x@,\verb@xyz cs:y@,\verb@xyz cs:z@
それぞれ$x$軸,$y$軸,$z$軸の単位ベクトルを何倍するかを指定する.
\begin{tikzpicture}[->]
\draw(0,0)--(xyz cs:x=2);
\draw(0,0)--(xyz cs:y=2);
\draw(0,0)--(xyz cs:z=2);
\begin{scope}[red,line width=1pt]
\draw(0,0)--(xyz cs:x=1);
\draw(0,0)--(xyz cs:y=1);
\draw(0,0)--(xyz cs:z=1);
\end{scope}
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[->]
\draw(0,0)--(xyz cs:x=2);
\draw(0,0)--(xyz cs:y=2);
\draw(0,0)--(xyz cs:z=2);
\begin{scope}[red,line width=1pt]
\draw(0,0)--(xyz cs:x=1);
\draw(0,0)--(xyz cs:y=1);
\draw(0,0)--(xyz cs:z=1);
\end{scope}
\end{tikzpicture}
\end{verbatim}
これも,カンマで区切られた3つの数値によって簡単に記述することができるが,
canvas coordinate system とは異なり,dimension を記述することはできない.
\begin{tikzpicture}[->]
\draw(0,0)--(2,0);
\draw(0,0)--(0,2,0);
\draw(0,0)--(0,0,2);
\begin{scope}[red,line width=1pt]
\draw(0,0)--(1,0);
\draw(0,0)--(0,1,0);
\draw(0,0)--(0,0,1);
\end{scope}
\end{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[->]
\draw(0,0)--(2,0);
\draw(0,0)--(0,2,0);
\draw(0,0)--(0,0,2);
\begin{scope}[red,line width=1pt]
\draw(0,0)--(1,0);
\draw(0,0)--(0,1,0);
\draw(0,0)--(0,0,1);
\end{scope}
\end{tikzpicture}
\end{verbatim}