Tag Info

Hot answers tagged

198

The following image illustrates the blowup of a plane at a point--an important construction in algebraic geometry (compare the cover of this book). The image was produced using Asymptote. (Note: the code and the image have both been refined since they were first posted.) The vector image may be viewed by following this link. settings.outformat="pdf"; ...


168

Electric field due to 3 charges. The black one is a negative charge orbiting the other two positive charges. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-electricfield} \begin{document} \multido{\i=0+15}{24}{% \begin{pspicture*}(-4,-4)(4,4) \psElectricfield[Q={[-1 3 \i\space PtoC][1 1 1][1 -1 -1]},linecolor=red] \end{pspicture*}} ...


167

\documentclass[border=0pt,pstricks]{standalone} \usepackage{pst-coil,pstricks-add} \usepackage[nomessages]{fp} \FPset\CoilArm{0.25} \FPset\CoilWidth{0.3} \FPeval\CoilTurn{round(50/3:3)} \FPeval\DeltaY{0.5} \FPeval\Amp{1.5} \FPeval\FPS{25} \FPeval\Vx{2}% propagation speed \FPeval\Period{1}% second \psset { coilarm=\CoilArm, coilwidth=\CoilWidth, } ...


162

One that I'm most proud of is a three-dimensional illustration of a signpost with various loads applied, shown here. I used the TikZ package. Commercial fonts have been removed in the code I've posted below. Looking back at the code, I probably could have written it a bit more efficiently (styles for face shading, more relative positioning, etc.), but c'est ...


158

One of my favorites; this one's not so involved but I enjoy the simplicity of the code and the quality of the result. It uses pgfplots to display streamline data for vortex shedding from a square block at Re=100. The streamline data were computed by a Fortran code I wrote to model the flow. The code: \documentclass{standalone} \usepackage{pgfplots} % ...


101

This very same image was not used in a publication. I copied the idea from a journal article and remade it using PSTricks and pst-optexp: \documentclass{standalone} \usepackage{pst-optexp} \begin{document} \begin{pspicture}(-0.2,0)(12.3,8.8) \newpsobject{laser}{optbox}{position=start, innerlabel} \psset[optexp]{lens=2, phwidth=0.07, outerheight=0.6} ...


98

Plan B as per tohecz: I'm a security engineer at Facebook and this is my fault. Properties of water and steam (IAPWS-SF95 formulation), enthalpy-entropy diagram, actually used by our students (and colleagues, from time to time). Compiled with lualatex for memory reasons. I'll not post the code here, as it is quite a lot and wouldn't work on other computers ...


96

Inspired by @Paul Gessler, the following is a statics problem from a class I taught. The problem was to find the maximum weight the crane could carry as a function of distance before it would tip over (the supports at D and E aren't bolted to the ground). It uses the drawing and plotting capabilities of TiKZ to draw the crane and the solution. Looking back, ...


89

For those who study radar imaging, the following should be relevant. \documentclass[pstricks,border=12pt]{standalone} \usepackage{multido} \SpecialCoor \psset{dimen=monkey} \definecolor{radar}{RGB}{77,255,116} \newpsstyle{wedge}{linestyle=none,linewidth=0,fillstyle=solid,fillcolor=radar} \newpsstyle{beam}{linewidth=.5pt,linecolor=radar} ...


87

Probably most people don't remember what π is. The following animation will scientifically show that when a wheel rolls one lap without slipping, it travels a distance of 3++ times of its diameter. \documentclass[pstricks,border=12pt,12pt]{standalone} \usepackage{pst-plot} \psset{unit=2cm,dimen=m} \newdimen\Width\Width=3.64159265\psxunit ...


86

Nothing too spectacular, but here's one from a presentation I did recently, showing the meaning of parton distribution functions. and a better view of the "floor": and the TikZ source: \documentclass[landscape]{article} \usepackage{siunitx} \usepackage{tikz} \usepackage{pgfplots} \usepackage{drawproton} \usetikzlibrary{calc} \usetikzlibrary{fadings} ...


83

Manuel Luque's Syracuse website has a number of neat technical examples that includes some animations (forgive the loading; images/animations are linked to the source):


80

Maybe not my best, but one I quite like. The figure has been made for a publication below about increasing the field of view of microtomographic scans and can be found in doi:10.1107/S0909049510019618. As with pretty much all my figures, it's made with the help of tikz, pgfplots, siunitx, my script to calculate and place scalebars, lots of trial and error ...


78

Just to get things going... \documentclass[border=0.125cm]{standalone} \usepackage{tikz} \tikzset{gift box/.cd, x/.store in=\gbx, y/.store in=\gby, z/.store in=\gbz, x=0,y=0,z=0 } \tikzdeclarecoordinatesystem{gift box}{% \tikzset{x=(-20:1cm),y=(200:1cm),z=(90:1cm)}% \tikzset{gift box/.cd, #1}% ...


76

The scientific viewpoint of an egg on the frying pan. \documentclass[pstricks]{standalone} \usepackage{pst-node,pst-plot} \begin{document} \pstVerb{realtime srand}% \psLoop{25}{% \begin{pspicture}(-2,-2)(2,2) \pscircle*[linecolor=orange]{0.75} \curvepnodes[plotpoints=73]{0}{360}{Rand 10 div 1.50 add t PtoC}{P} \def\points{}% ...


75

This is one I like from my thesis. It illustrates the predicted boundaries for boundary layer transition mechanisms on a cylindrical afterbody at incidence: (1) free shear-layer instability, (2) attachment-line instability, (3) cross-flow instability, (4) streamwise-flow instability. \documentclass{standalone} \usepackage{calc,pgfplots} ...


65

Transformer \documentclass{article} \usepackage[ hmargin = 2.4cm, vmargin = 3cm ]{geometry} \usepackage[ figureposition = bottom ]{caption} \usepackage{pst-solides3d} % Upright text as subscript in math mode. \makeatletter \begingroup \catcode`\_=\active \protected\gdef_{\@ifnextchar|\subtextup\sb} \endgroup ...


59

The following is a TikZ version of a three-tier data center architecture (the reference was Figure 3-8 Three-Tier Model with 8-Way ECMP of Cisco Data Center Infrastructure 2.5 Design Guide). The code is ugly, unreadable so take it as it is. Though, it is highly inspired by Q/A of the site: some of you may recognize your own piece of code somewhere. The ...


58

For some reason I am particularly proud of this one. It was an 3D-coloured illustration for a finite-element mesh upon a spheroid (confocal to another, non-represented inner spheroid which parameters are also to be found in this program) designed for an old paper research. It could have been done with Asymptote, which is my best tool for 3D, but for this ...


58

What a good question! I'm surprised that no-one's asked this before ... There are two pieces to the puzzle here: getting the end circles right, and deciding where to draw the edges. The first turns out to actually be easy - if you know what to look for in the TikZ manual. The second takes a little bit of maths, but not too much. Let's deal with the ...


56

Christian was faster, but because I invested the time, here's my take on showing how the bivariate distribution results from the two univariate ones. There are a couple of things in the code that might be useful for you: You can define mathematical functions using declare function={<name>(<argument macros>)=<function>;}, which will help ...


54

The following figure is one of my favorites. The goal of the image is to explain the definition of the derivative, in the form that "f'(x_0) = m if within sufficiently small neighborhoods of x_0, f can be contained in arbitrarily narrow cones about the line through (x_0,f(x_0)) with slope m." The figure was created in TikZ. If I were to create it now, I ...


51

Here is a picture intended to explain the disk method for computing the volume of a solid of revolution. I originally created it for my calculus class; I later redrew it to use as the central example in my still-unfinished Asymptote tutorial. Consequently, the code is fairly mature. It is, of course, drawn using Asymptote. The source code: //Function ...


51

When I was [for]playing with theory of envelopes, I made several drawings with lualatex anad tikz. Lualatex solely because I'm not comfortable with programming in tikz. Here is one of my favorites, Lemniscate envelope: \documentclass{article} \usepackage[margin=0cm,a4paper,landscape]{geometry} \usepackage{luacode} \usepackage{pgfplots} \usepackage{float} ...


48

If you throw a ball at a certain angle between 0 and 90 degrees relative to the horizontal line, the trajectory of the ball is a parabolic curve. The vertical component of its velocity is changing while the horizontal one remains unchanged. The following code has not been optimized yet. \documentclass[pstricks,border={12pt 32pt 26pt 12pt}]{standalone} ...


46

Here's a Sketch/TikZ approach. Running sketch on this file: def helix { def n_segs 600 sweep [draw=orange] { n_segs, rotate(24*360 / n_segs, (1.5,0,0), [0,0,1]), rotate(1*360/n_segs, (0,0,0), [0,1,0]) } (2.01,0,0) } def torus { def n_segs 60 sweep [draw=none, fill=cyan, fill opacity=0.75] {n_segs, rotate(360/n_segs, (0,0,0), [0,1,0])} ...


41

The example shows the function x(u,v)=(R1 + (R0 +RL*sin(u))*sin(k*v))*cos(v)-RL*cos(u)*sin(v) y(u,v)=(R1 + (R0 +RL*sin(u))*sin(k*v))*sin(v)+RL*cos(u)*cos(v) z(u,v)=(R0 + RL*sin(u))*cos(k*v) with the parameter setting shown in the example. RL: radius of the coil line; R1: Torus outer; R0: Torus inner radius; k:number of coils run it with xelatex or ...


41

A cylindrical volume charge distribution and its electric field strength on the point (0,0,b). \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \tikzset{ dim above/.style={to path={\pgfextra{ \pgfinterruptpath \draw[>=latex,|<->|] let \p1=($(\tikztostart)!2mm!90:(\tikztotarget)$), ...


40

run with xelatex \documentclass{article} \usepackage{pst-solides3d} \begin{document} \psset{viewpoint=50 20 30 rtp2xyz,Decran=50} \begin{pspicture}[solidmemory](-4,-4)(6,5) \psset{unit=0.5} \psSolid[object=plan,action=draw**,definition=equation,args={[0 0 1 0]}, base=-4 4 -4 4,fillcolor=black!15,fillstyle=solid,name=P0] ...


39

Wasn't sure if "something like that" meant "as near to that as possible". Either way I went with: \documentclass{standalone} \usepackage{tikz} \renewcommand{\familydefault}{\sfdefault} \begin{document} \colorlet{crystal}{blue!75} \def\zangle{-20} \def\xangle{20} \begin{tikzpicture}[x=(\xangle:0.75cm), y=(90:1cm), z=(\zangle:1.5cm), >=stealth, line ...



Only top voted, non community-wiki answers of a minimum length are eligible