Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[border=0pt,10pt,dvipsnames]{standalone}
- usepackage{amsmath}
- usepackage{pstricks}
- usepackage{dashrule}
- usepackage{pst-plot}%, pst-math}
- usepackage{pst-func}
- usepackage{pst-ode}
- usepackage{pst-3dplot}
- usepackage{pst-solides3d}
- usepackage[off]{auto-pst-pdf}
- usepackage[nomessages]{fp}
- psset{algebraic,unit=2}
- usepackage[active,tightpage]{preview}
- PreviewBorder=12pt
- PreviewEnvironment{pspicture}
- makeatletter
- deflistplotIIID{defpst@par{}pst@object{listplotIIID}}
- deflistplotIIID@i#1{%
- @nameuse{beginplot@psplotstyle}%
- addto@pscode{%
- /viewpointXYZ {pst@solides@viewpoint} def
- /Decran pst@solides@Decranspace def % distance de l'ecran
- viewpointXYZ /ZpointVue ED /YpointVue ED /XpointVue ED
- /THETA {YpointVue XpointVue atan} bind def
- /PHI {ZpointVue XpointVue dup mul YpointVue dup mul add sqrt atan} bind def
- /Dobs {XpointVue dup mul YpointVue dup mul add ZpointVue dup mul add sqrt} bind def
- XpointVue YpointVue ZpointVue /viewpoint defpoint3d
- /XYZ [#1] def
- /@tabXYZ [
- 0 3 XYZ length 3 sub {/i exch def
- XYZ i get
- XYZ i 1 add get
- XYZ i 2 add get
- 3dto2d
- pst@numberpsunit mul exch
- pst@numberpsunit mul exch
- } for
- ] bind def
- [ @tabXYZ aload pop
- }%
- @nameuse{endplot@psplotstyle}}%
- makeatother
- defr(#1){0.25*sqrt((9-#1*#1)*(#1*#1+1))}
- defrs(#1){-(1/4)*#1*(#1^2-4)/sqrt(-(#1^2-9)*(#1^2+1))}
- defrss(#1){-(1/4)*(#1^6-12*#1^4-27*#1^2+36)/((#1^2-9)*(#1^2+1)*sqrt(-(#1^2-9)*(#1^2+1))) }
- begin{document}
- begin{pspicture}(-2.1,-1.1)(2.5,1.2)
- psset[pst-solides3d]{viewpoint=20 5 20,Decran=20,lightsrc=viewpoint}
- defFunction[algebraic]{rot}(t,v){r(t)*sin(v)} {t} {r(t)*cos(v)}
- psSolid[object=surfaceparametree,base=-3 3 0 6.28,
- inhue=0.01 0.11, hue=0.1 0,
- function=rot,linewidth=0.5pt,grid=false,opacity=0.8,ngrid=200 70,
- intersectiontype=0,
- %% Intersections with planes [a b c d] = ax + by + cz + d = 0
- intersectionplan={[0 1 0 0] [0 1 0 -2.828] [0 0 1 0]},
- intersectioncolor=(red) (red) (blue),
- intersectionlinewidth=1 1]
- axesIIID(1,3,1)(2,3.5,2)
- pstODEsolve[algebraic,algebraicOutputFormat]{test}{r(x[2])*sin(x[0])
- | x[2] | r(x[2])*cos(x[0])}{0}{14}{2000}{1.57 1 2.8284 0}{ x[1] |
- -2*rs(x[2])*x[1]*x[3]/(r(x[2]))| x[3] |
- -rss(x[2])*rs(x[2])*x[3]*x[3]/(rs(x[2])*rs(x[2])+1)
- +rs(x[2])*r(x[2])*x[1]*x[1]/(rs(x[2])*rs(x[2])+1)}
- listplotIIID[linecolor=black,linewidth=1pt]{test}
- pstODEsolve[algebraic,algebraicOutputFormat]{test}{r(x[2])*sin(x[0]) |
- x[2] | r(x[2])*cos(x[0])}{0}{2}{500}{1.57 -1 2.8284 0}{ x[1] |
- -2*rs(x[2])*x[1]*x[3]/(r(x[2]))| x[3] |
- -rss(x[2])*rs(x[2])*x[3]*x[3]/(rs(x[2])*rs(x[2])+1)
- +rs(x[2])*r(x[2])*x[1]*x[1]/(rs(x[2])*rs(x[2])+1)}
- listplotIIID[linecolor=black,linewidth=1pt]{test}
- psSolid[object=point,args=0.75 2.828 0]
- end{pspicture}
- end{document}
- documentclass[border=0pt,10pt,dvipsnames,pstricks]{standalone}
- usepackage{amsmath}
- usepackage{dashrule}
- usepackage{pst-plot}%, pst-math}
- usepackage{pst-func}
- usepackage{pst-ode}
- usepackage{pst-3dplot}
- usepackage{pst-solides3d}
- usepackage[nomessages]{fp}
- psset{algebraic,unit=2}
- makeatletter
- define@key[psset]{}{valuerange}[1-]{expandafterpst@getrange#1@nil}
- defpst@getrange#1-#2@nil{%
- ifxrelax#1relax defpst@startvalue{1 }elsedefpst@startvalue{#1 }fi%
- ifxrelax#2relax defpst@endvalue{1e32 }elsedefpst@endvalue{#2 }fi%
- }
- psset{valuerange=1-}
- deflistplotIIID{defpst@par{}pst@object{listplotIIID}}
- deflistplotIIID@i#1{%
- @nameuse{beginplot@psplotstyle}%
- addto@pscode{%
- /viewpointXYZ {pst@solides@viewpoint} def
- /Decran pst@solides@Decranspace def % distance de l'ecran
- viewpointXYZ /ZpointVue ED /YpointVue ED /XpointVue ED
- /THETA {YpointVue XpointVue atan} bind def
- /PHI {ZpointVue XpointVue dup mul YpointVue dup mul add sqrt atan} bind def
- /Dobs {XpointVue dup mul YpointVue dup mul add ZpointVue dup mul add sqrt} bind def
- XpointVue YpointVue ZpointVue /viewpoint defpoint3d
- /XYZ [#1] def
- /@tabXYZ [
- 0 3 XYZ length 3 sub {
- /i exch def
- XYZ i get
- XYZ i 1 add get
- XYZ i 2 add get
- i 3 div dup /ii ED
- pst@startvalue ge {
- ii pst@endvalue le {
- 3dto2d
- pst@numberpsunit mul exch
- pst@numberpsunit mul exch
- } { pop pop pop } ifelse
- }{ pop pop pop } ifelse
- } for
- ] bind def
- [ @tabXYZ aload pop
- }%
- @nameuse{endplot@psplotstyle}}%
- makeatother
- defr(#1){0.25*sqrt((9-#1*#1)*(#1*#1+1))}
- defrs(#1){-(1/4)*#1*(#1^2-4)/sqrt(-(#1^2-9)*(#1^2+1))}
- defrss(#1){-(1/4)*(#1^6-12*#1^4-27*#1^2+36)/((#1^2-9)*(#1^2+1)*sqrt(-(#1^2-9)*(#1^2+1))) }
- begin{document}
- begin{pspicture}(-2.1,-1.1)(2.5,1.2)
- psset[pst-solides3d]{viewpoint=20 5 20,Decran=20,lightsrc=viewpoint}
- defFunction[algebraic]{rot}(t,v){r(t)*sin(v)} {t} {r(t)*cos(v)}
- %psSolid[object=surfaceparametree,base=-3 3 0 6.28,inhue=0.01 0.11, hue=0.1 0,
- % function=rot,linewidth=0.5pt,grid=false,opacity=0.8,ngrid=200 70,
- % intersectiontype=0,
- % %% Intersections with planes [a b c d] = ax + by + cz + d = 0
- % intersectionplan={[0 1 0 0] [0 1 0 -2.828] [0 0 1 0]},
- % intersectioncolor=(red) (red) (blue),
- % intersectionlinewidth=1 1]
- axesIIID(1,3,1)(2,3.5,2)
- pstODEsolve[algebraic,algebraicOutputFormat,%saveData
- ]{test}{r(x[2])*sin(x[0])
- | x[2] | r(x[2])*cos(x[0])}{0}{14}{2000}{1.57 1 2.8284 0}{ x[1] |
- -2*rs(x[2])*x[1]*x[3]/(r(x[2]))| x[3] |
- -rss(x[2])*rs(x[2])*x[3]*x[3]/(rs(x[2])*rs(x[2])+1)
- +rs(x[2])*r(x[2])*x[1]*x[1]/(rs(x[2])*rs(x[2])+1)}
- listplotIIID[linewidth=1pt,linecolor=red,valuerange={-50}]{test}
- listplotIIID[linewidth=1pt,linecolor=green,valuerange={50-100}]{test}
- listplotIIID[linewidth=1pt,linecolor=blue,valuerange={100-}]{test}
- pstODEsolve[algebraic,algebraicOutputFormat]{test}{
- r(x[2])*sin(x[0]) |
- x[2] |
- r(x[2])*cos(x[0])}{0}{2}{500}{1.57 -1 2.8284 0}{ x[1] |
- -2*rs(x[2])*x[1]*x[3]/(r(x[2]))| x[3] |
- -rss(x[2])*rs(x[2])*x[3]*x[3]/(rs(x[2])*rs(x[2])+1)
- +rs(x[2])*r(x[2])*x[1]*x[1]/(rs(x[2])*rs(x[2])+1)}
- listplotIIID[linewidth=1pt,linecolor=cyan,valuerange={-50}]{test}
- listplotIIID[linewidth=1pt,linecolor=magenta,valuerange={50-100}]{test}
- listplotIIID[linewidth=1pt,linecolor=gray,valuerange={100-}]{test}
- %psSolid[object=point,args=0.75 2.828 0]
- end{pspicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement