# TikZ: how would we construct a bullet?

I am drawing a block hanging from a string, but at some time later, the block is struck by a bullet. I am trying to construct a crude bullet but that seems to be harder than I have anticipated.

Thus how do we draw a bullet?

\documentclass[tikz]{standalone}

%  draws block hanging from a string
\newcommand\block{
\draw (0, 0) -- (0, -1.5cm) -- (-.5cm, -1.5cm) rectangle (.5cm, -2.5cm);}

\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0, 0);
\coordinate (P1) at (0, -1.5cm);

\block

\begin{scope}[rotate = 60]
\coordinate (P2) at (0, -1.5cm);

\block
% trying to draw a bullet
%\draw (0, -2cm) -- ++(0, -.25cm) -- ++(;
\end{scope}
\end{tikzpicture}
\end{document}


Bullets:

-
Is there something wrong with \textbullet? (Perhaps too crude?) –  Sean Allred May 13 '14 at 16:28
@SeanAllred I am speaking of something that resembles a bullet fired from a weapon. –  dustin May 13 '14 at 16:29
Yes, but there are many shapes that these bullets can take. Rifle bullets, shot, pellets, … the list goes on. Can you upload a sketch of what you're looking for? (Not a physics guy, myself.) –  Sean Allred May 13 '14 at 16:31
@SeanAllred if we used pellets from a shotgun, that would be numerous strikes to the block. I want just one bullet strike. See image for bullets. –  dustin May 13 '14 at 16:34

Quick and crude.

\begin{tikzpicture}[scale=0.3]

\coordinate (A) at (2,3);  % To position the bullet in another fig

\begin{scope}[shift={(A)}, rotate=30]
\fill[draw=black!80, top color=black!10, bottom color=black!70]
(0,1) -- (1.5, 1) to [out=0, in=120] (2.5,0.5)
to[out=-120, in=0] (1.5,0) -- (0,0) --cycle;
\draw[white, draw opacity=0.5] (0,0.1) -- (2.3,0.1);
\end{scope}

\end{tikzpicture}


Update: little embellishments.

\begin{tikzpicture}

\coordinate (A) at (2,3);  % To position the bullet in another fig

\begin{scope}[shift={(A)}, rotate=30]
\fill[top color=black!10, bottom color=black!70]
(0,1) -- (1.5, 1) to [out=0, in=120] (2.5,0.5) to[out=-120, in=0] (1.5,0) -- (0,0) --cycle;
\draw[white, draw opacity=0.5, line cap=round, line width=0.8mm] (0,0.1) -- (1.5,0.1) to[out=0, in=-140] (2.5,0.5)  (0.02,0) -- (0.02,1) (0.2,0) -- (0.2,1);
\draw[black!80, line width=0.4mm]   (0,1) -- (1.5, 1) to [out=0, in=120] (2.5,0.5) to[out=-120, in=0] (1.5,0) -- (0,0) --cycle (0.18,0) -- (0.18,1);
\end{scope}

\end{tikzpicture}


-
What is this out in syntax? I have never seen it before. –  dustin May 13 '14 at 16:51
It is an easy syntax to draw curved paths. You sepecify the angle at which the path departs from its starting point (out), and the angle at which it arrives at its end (in) –  JLDiaz May 13 '14 at 16:54

I just imported your bullet graphic and cropped it down to bullet1.jpg, and then wrapped your ballistic pendulum in a \stackinset.

\documentclass[tikz]{article}
\usepackage{stackengine}
\usepackage{graphicx}
\usepackage{tikz}
%  draws block hanging from a string
\newcommand\block{
\draw (0, 0) -- (0, -1.5cm) -- (-.5cm, -1.5cm) rectangle (.5cm, -2.5cm);}

\begin{document}
\stackinset{r}{3.05cm}{b}{.48cm}%
{\scalebox{.1}{\rotatebox{-90}{\includegraphics{bullet1}}}}{%
\begin{tikzpicture}
\coordinate (O) at (0, 0);
\coordinate (P1) at (0, -1.5cm);
%
\block
%
\begin{scope}[rotate = 60]
\coordinate (P2) at (0, -1.5cm);
%
\block
% trying to draw a bullet
%\draw (0, -2cm) -- ++(0, -.25cm) -- ++(;
\end{scope}
\end{tikzpicture}
}
\end{document}


By defining the bullet placement relative to the right horizontal edge, it will mean than any bullet graphic imported should give the same bullet-tip placement, even if the graphic is of different size/shape. For example, here it is with bullet2.jpg, with the \stackinset parameters the same.

Also, \stackinsets can be nested, if you want your bullet, or a deformed variant of it, to appear in the target block:

\documentclass[tikz]{article}
\usepackage{stackengine}
\usepackage{graphicx}
\usepackage{tikz}
%  draws block hanging from a string
\newcommand\block{
\draw (0, 0) -- (0, -1.5cm) -- (-.5cm, -1.5cm) rectangle (.5cm, -2.5cm);}

\begin{document}
\stackinset{r}{.65cm}{b}{1.35cm}%
{\scalebox{.04}{\rotatebox{-30}{\includegraphics{bullet3b}}}}{%
\stackinset{r}{3.05cm}{b}{.48cm}%
{\scalebox{.04}{\rotatebox{-90}{\includegraphics{bullet3a}}}}{%
\begin{tikzpicture}
\coordinate (O) at (0, 0);
\coordinate (P1) at (0, -1.5cm);
%
\block
%
\begin{scope}[rotate = 60]
\coordinate (P2) at (0, -1.5cm);
%
\block
% trying to draw a bullet
%\draw (0, -2cm) -- ++(0, -.25cm) -- ++(;
\end{scope}
\end{tikzpicture}
}}
\end{document}


-

A parameterized head of a bullet with PSTricks.

\documentclass[pstricks]{standalone}
\usepackage{pst-plot}

\def\bottom#1{\psparametricplot{0}{2}{-#1*t^2+14|t}\psline(1,2)}

\begin{document}
\multido{\r=1.1+.1}{10}{%
\begin{pspicture}[algebraic](0,-3)(15,3)
\pscustom[fillstyle=solid,fillcolor=gray,linewidth=2pt]
{
\bottom{\r}
\reversepath
\scale{1 -1}
\bottom{\r}
\closepath
}
\end{pspicture}}

\end{document}


-
the bullet has the hiccup! –  jfbu May 13 '14 at 17:35