ナンクル力学系

学んだ事を書き連ねていこう。

PSTricksで多様体の図

leave a comment »

PSTrickで作った図で,解析力学のテキストを書こうと思ってたときに書いたやつがあるのでなんとなく載せてみる.ひとつ何かつくれば,あとはソースの使いまわしで色々書けそうだと思って書いたんだよな.使いたい人居たら使って欲しいかもしれないけど,そういうニッチな人は居ないかもしれない.

こんなやつ:

ソースコード:
(追記:ソースコードは,Snipplrに貼ると良いことに気づいた > http://snipplr.com/view/5809/pstrick-manifold-and-tangent-space/

\documentclass[12pt]{article}
\usepackage{pstricks} % To use the standard “xcolor” package with PSTricks
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Draw manifold and tangent sapce %%%%%%%%%%%
\newcommand{\ManAndTan}[6]{%
\rput(#1){%
% Manifold と Tangent Space はそれぞれ二回描画してるので変更の時は注意
% Manifold
\psccurve[framearc=0.3,
fillstyle=solid,
fillcolor=lightgray]% 背景色
(-1,-1)(0,-1.5)(2,-1.2)(2.6,-0.4)(1,2)(-1,1)
% Tangent Space
\pspolygon[fillstyle=solid,
fillcolor=white,% 背景色
linestyle=none]
(-1,0)(0,-1)(2.5,1.5)(1.5,2.5)
% Draw curve on the manifold
\begin{psclip}{% No background and no line
\psccurve[framearc=0.3,
linestyle=none]
(-1,-1)(0,-1.5)(2,-1.2)(2.6,-0.4)(1,2)(-1,1)
}
\psbezier[linecolor=gray](-1,-1)(0,0)(2,2)(2,-2)% cliped curve
\end{psclip}
% Tangent Space
\pspolygon(-1,0)(0,-1)(2.5,1.5)(1.5,2.5)
% Tangent Vector
\psline[linewidth=2pt]{*->}(0,0)(1.5,1.5)
% 文字
\rput(-0.8, 1.7){#2}% M
\rput( 2.5, 2.2){#3}% T_m M
\rput( 1 , 1.4){#4}% v
\rput( 1.6,-0.5){#5}% c(t)
\rput(-0.4, 0 ){#6}% m
}
}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Draw chat on Euclid space %%%%%%%%%%%%%%%%%
\newcommand{\EuclidSpace}[4]{%
\rput(#1){%
\psline{->}(-1,0)(2,0)
\psline{->}(0,-1)(0,2)
\begin{psclip}{% No background and no line
\psccurve[framearc=0.3](-0.5,-0.5)(0.5,-0.8)(1.5,0)(1.1,1.4)(-0.5,1)
}
\psbezier[linecolor=lightgray](-1,-1)(0,0)(2,2)(2,-2)% cliped curve
\end{psclip}
\rput(0.4,2.2){#2}
\rput(1.5,1.5){#3}
\rput(0.7,0.7){#4}
}
}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{empty}
\begin{document}\psset{linewidth=1pt,arrowsize=0.2}%,showpoints=true}
\begin
{pspicture}*(-2,-2)(11,11)
% TM
\ManAndTan{0,3}{$M$}{$T_m M$}{$v$}{$c(t)$}{$m$}
\ManAndTan{5,7}{$N$}{$T_n N$}{$w$}{$f \circ c(t)$}{$n$}
\ManAndTan{8,3}{$P$}{$T_p P$}{}{$g \circ f \circ c(t)$}{$p$}
% R^m
\EuclidSpace{0,8}{$R^m$}{$U$}{$\varphi(c(t))$}
% R
\psline{->}(-1,0)(2,0)
\rput(2.2,0.3){$t \in R$}
% 線種をdashedに設定. 以下で描く矢印に適用
\psset{linestyle=dashed}
% -> \phi
\pscurve{->}(0,3)(-0.5,5.5)(0,8)
\rput(-0.2,6){$\varphi$}
% c(t)
\pscurve{->}(0,0)(-0.2,1)(0,3)
\rput(0.1,1){$c$}
% f
\pscurve{->}(0,3)(4,4)(5,7)
\pscurve{->}(5,7)(6.5,5)(8,3)
\rput(4,3.5){$f$}
\rput(6.5,4.6){$g$}
% g
\pscurve{->}(1,4)(3,7)(6,8)
\pscurve{->}(6,8)(8.4,6.5)(9,4)
\rput(2.3,7){$T_m f$}
\rput(8.2,6){$T_n g$}
% グリッドを描く
%\psgrid(0,0)(-2,-2)(11,11)
\end
{pspicture}
\end
{document}

Written by tkf

April 13, 2008 at 5:26 pm

Posted in tex, 微分幾何

Tagged with , ,

Leave a comment